diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2010-04-17 14:45:12 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2010-04-17 14:45:12 +0000 |
commit | 49a83dd965e93ad0fab145ebba65e4f6a199aaed (patch) | |
tree | 35740f2210e0eacc49cc2b97622e06919f6fdc42 /parsing | |
parent | 95d686c9d0a5d8df00746073b45c9f4c3810b094 (diff) |
merge branches/sigsubst 9626:10205
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10263 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/parser.mly | 11 | ||||
-rw-r--r-- | parsing/parsetree.mli | 4 | ||||
-rw-r--r-- | parsing/printast.ml | 4 |
3 files changed, 18 insertions, 1 deletions
diff --git a/parsing/parser.mly b/parsing/parser.mly index 7f107ee7b..6232e4fdc 100644 --- a/parsing/parser.mly +++ b/parsing/parser.mly @@ -1305,8 +1305,19 @@ with_constraint: ptype_loc = symbol_rloc()}) } /* used label_longident instead of type_longident to disallow functor applications in type path */ + | TYPE type_parameters label_longident COLONEQUAL core_type + { let params, variance = List.split $2 in + ($3, Pwith_typesubst {ptype_params = params; + ptype_cstrs = []; + ptype_kind = Ptype_abstract; + ptype_manifest = Some $5; + ptype_private = Public; + ptype_variance = variance; + ptype_loc = symbol_rloc()}) } | MODULE mod_longident EQUAL mod_ext_longident { ($2, Pwith_module $4) } + | MODULE mod_longident COLONEQUAL mod_ext_longident + { ($2, Pwith_modsubst $4) } ; with_type_binder: EQUAL { Public } diff --git a/parsing/parsetree.mli b/parsing/parsetree.mli index baa5e0245..05f92bd03 100644 --- a/parsing/parsetree.mli +++ b/parsing/parsetree.mli @@ -234,8 +234,10 @@ and modtype_declaration = and with_constraint = Pwith_type of type_declaration | Pwith_module of Longident.t + | Pwith_typesubst of type_declaration + | Pwith_modsubst of Longident.t -(* Value expressions for the module language *) +(* value expressions for the module language *) and module_expr = { pmod_desc: module_expr_desc; diff --git a/parsing/printast.ml b/parsing/printast.ml index 676cf622f..f63e21b87 100644 --- a/parsing/printast.ml +++ b/parsing/printast.ml @@ -567,7 +567,11 @@ and with_constraint i ppf x = | Pwith_type (td) -> line i ppf "Pwith_type\n"; type_declaration (i+1) ppf td; + | Pwith_typesubst (td) -> + line i ppf "Pwith_typesubst\n"; + type_declaration (i+1) ppf td; | Pwith_module (li) -> line i ppf "Pwith_module %a\n" fmt_longident li; + | Pwith_modsubst (li) -> line i ppf "Pwith_modsubst %a\n" fmt_longident li; and module_expr i ppf x = line i ppf "module_expr %a\n" fmt_location x.pmod_loc; |