diff options
| author | Brian Campbell | 2017-10-25 12:25:42 +0100 |
|---|---|---|
| committer | Brian Campbell | 2017-10-25 12:25:42 +0100 |
| commit | fd70c99777002114be5d14a89f169f6e239b9cac (patch) | |
| tree | 3e3472a89298f4e04fa3d56acebb900eb2f6201d /language | |
| parent | 63e6dc9ac7effde553cd446cc737a0ec28c5f39d (diff) | |
| parent | c4fafd80d816fd06a4091c217c43e232ac9a8706 (diff) | |
Merge branch 'experiments' into mono-experiments
Diffstat (limited to 'language')
| -rw-r--r-- | language/l2.ml | 22 | ||||
| -rw-r--r-- | language/l2.ott | 17 |
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 |
