summaryrefslogtreecommitdiff
path: root/language
diff options
context:
space:
mode:
Diffstat (limited to 'language')
-rw-r--r--language/l2.ml22
-rw-r--r--language/l2.ott17
2 files changed, 22 insertions, 17 deletions
diff --git a/language/l2.ml b/language/l2.ml
index 8f041dc7..c59ce838 100644
--- a/language/l2.ml
+++ b/language/l2.ml
@@ -285,7 +285,7 @@ type
type
-'a type_def_aux = (* type definition body *)
+type_def_aux = (* type definition body *)
TD_abbrev of id * name_scm_opt * typschm (* type abbreviation *)
| TD_record of id * name_scm_opt * typquant * ((typ * id)) list * bool (* struct type definition *)
| TD_variant of id * name_scm_opt * typquant * (type_union) list * bool (* tagged union type definition *)
@@ -298,9 +298,8 @@ type
KD_aux of 'a kind_def_aux * 'a annot
-type
-'a type_def =
- TD_aux of 'a type_def_aux * 'a annot
+type
+'a type_def = TD_aux of type_def_aux * 'a annot
type
@@ -480,7 +479,7 @@ type
type
-'a val_spec_aux = VS_val_spec of typschm * id * string option * bool
+val_spec_aux = VS_val_spec of typschm * id * string option * bool
type
@@ -489,7 +488,7 @@ type
type
-'a default_spec_aux = (* default kinding or typing assumption *)
+default_spec_aux = (* default kinding or typing assumption *)
DT_order of order
| DT_kind of base_kind * kid
| DT_typ of typschm * id
@@ -512,9 +511,8 @@ type
DEC_aux of 'a dec_spec_aux * 'a annot
-type
-'a val_spec =
- VS_aux of 'a val_spec_aux * 'a annot
+type
+'a val_spec = VS_aux of val_spec_aux * 'a annot
type
@@ -523,8 +521,8 @@ type
type
-'a default_spec =
- DT_aux of 'a default_spec_aux * Parse_ast.l
+default_spec =
+ DT_aux of default_spec_aux * Parse_ast.l
type
@@ -540,7 +538,7 @@ and 'a def = (* top-level definition *)
| DEF_spec of 'a val_spec (* top-level type constraint *)
| DEF_fixity of prec * int * id (* fixity declaration *)
| DEF_overload of id * (id) list (* operator overload specification *)
- | DEF_default of 'a default_spec (* default kind and type assumptions *)
+ | DEF_default of default_spec (* default kind and type assumptions *)
| DEF_scattered of 'a scattered_def (* scattered function and type definition *)
| DEF_reg_dec of 'a dec_spec (* register declaration *)
| DEF_comm of 'a dec_comm (* generated comments *)
diff --git a/language/l2.ott b/language/l2.ott
index e8d8a9b7..579f26b3 100644
--- a/language/l2.ott
+++ b/language/l2.ott
@@ -421,9 +421,12 @@ grammar
%%% OR, IN C STYLE
-type_def :: 'TD_' ::=
+type_def {{ ocaml 'a type_def }} :: 'TD_' ::=
+ {{ ocaml TD_aux of type_def_aux * 'a annot }}
+ | type_def_aux :: :: aux
+
+type_def_aux :: 'TD_' ::=
{{ com type definition body }}
- {{ aux _ annot }} {{ auxparam 'a }}
| typedef id name_scm_opt = typschm :: :: abbrev
{{ com type abbreviation }} {{ texlong }}
| typedef id name_scm_opt = const struct typquant { typ1 id1 ; ... ; typn idn semi_opt } :: :: record
@@ -959,9 +962,13 @@ letbind :: 'LB_' ::=
| let pat = exp :: :: val
{{ com let, implicit type ($[[pat]]$ must be total)}}
-val_spec :: 'VS_' ::=
+val_spec {{ ocaml 'a val_spec }} :: 'VS_' ::=
+ {{ ocaml VS_aux of val_spec_aux * 'a annot }}
+ | val_spec_aux :: :: aux
+
+
+val_spec_aux :: 'VS_' ::=
{{ com value type specification }}
- {{ aux _ annot }} {{ auxparam 'a }}
{{ ocaml VS_val_spec of typschm * id * string option * bool }}
| val typschm id :: S :: val_spec
{{ com specify the type of an upcoming definition }}
@@ -978,7 +985,7 @@ val_spec :: 'VS_' ::=
default_spec :: 'DT_' ::=
{{ com default kinding or typing assumption }}
- {{ aux _ l }} {{ auxparam 'a }}
+ {{ aux _ l }}
| default Order order :: :: order
| default base_kind kid :: :: kind
| default typschm id :: :: typ