diff options
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/parser.mly | 2 | ||||
-rw-r--r-- | parsing/parsetree.mli | 1 | ||||
-rw-r--r-- | parsing/printast.ml | 3 |
3 files changed, 6 insertions, 0 deletions
diff --git a/parsing/parser.mly b/parsing/parser.mly index a21fdd8590..d12c314463 100644 --- a/parsing/parser.mly +++ b/parsing/parser.mly @@ -519,6 +519,8 @@ module_type: { mkmty(Pmty_functor($3, $5, $8)) } | module_type WITH with_constraints { mkmty(Pmty_with($1, List.rev $3)) } + | MODULE TYPE OF module_expr + { mkmty(Pmty_typeof $4) } | LPAREN module_type RPAREN { $2 } | LPAREN module_type error diff --git a/parsing/parsetree.mli b/parsing/parsetree.mli index 0307cea547..72cfd3a467 100644 --- a/parsing/parsetree.mli +++ b/parsing/parsetree.mli @@ -207,6 +207,7 @@ and module_type_desc = | Pmty_signature of signature | Pmty_functor of string * module_type * module_type | Pmty_with of module_type * (Longident.t * with_constraint) list + | Pmty_typeof of module_expr and signature = signature_item list diff --git a/parsing/printast.ml b/parsing/printast.ml index d35f74949c..514fbf7795 100644 --- a/parsing/printast.ml +++ b/parsing/printast.ml @@ -510,6 +510,9 @@ and module_type i ppf x = line i ppf "Pmty_with\n"; module_type i ppf mt; list i longident_x_with_constraint ppf l; + | Pmty_typeof m -> + line i ppf "Pmty_typeof\n"; + module_expr i ppf m and signature i ppf x = list i signature_item ppf x |