Skip to content

Commit 1568ab8

Browse files
committed
feature(*): Add simple toplevel module and BigInt literals
Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
1 parent fb23b86 commit 1568ab8

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.d
22
*.vo
3+
*.vio
34
*.glob
45

56
TAGS

coq-jsast.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
opam-version: "2.0"
22
name: "coq-jsast"
3-
version: "2.0.0"
3+
version: "3.0.0"
44
synopsis: "A minimal JavaScript syntax tree carved out of the JsCert project"
55
description: """
66
A minimal JavaScript syntax tree carved out of the JsCert project, with additional support for let bindings and using native floats.

coq/JsSyntax.v

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Set Implicit Arguments.
22
Require Export Ascii String.
33
Require JsNumber.
4+
Require Import ZArith.
45
Notation "'number'" := (JsNumber.number).
56

67

@@ -63,7 +64,8 @@ Inductive literal :=
6364
| literal_null : literal
6465
| literal_bool : bool -> literal
6566
| literal_number : number -> literal
66-
| literal_string : string -> literal.
67+
| literal_string : string -> literal
68+
| literal_bigint : Z -> literal.
6769

6870
(** Labels literals used by break and continue keywords,
6971
including the special "empty" label. *)
@@ -187,3 +189,12 @@ Coercion stat_expr : expr >-> stat.
187189
Coercion label_string : string >-> label.
188190

189191

192+
Inductive topdecl :=
193+
| strictmode : topdecl (** strict mode declaration *)
194+
| comment : string -> topdecl (** comment *)
195+
| elementdecl : element -> topdecl (** Program element *)
196+
| classdecl : string -> list funcdecl -> topdecl (** Class declarations *)
197+
| constdecl : string -> expr -> topdecl (** Constant declarations *)
198+
.
199+
200+
Definition module := list topdecl.

0 commit comments

Comments
 (0)