diff options
Diffstat (limited to 'tools/untypeast.ml')
| -rw-r--r-- | tools/untypeast.ml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/untypeast.ml b/tools/untypeast.ml index 75f7ebdecc..26993440ae 100644 --- a/tools/untypeast.ml +++ b/tools/untypeast.ml @@ -62,7 +62,8 @@ and untype_structure_item item = | Tstr_recmodule list -> Pstr_recmodule (List.map untype_module_binding list) | Tstr_modtype mtd -> - Pstr_modtype {pmtd_name=mtd.mtd_name; pmtd_type=option untype_module_type mtd.mtd_type; pmtd_attributes=mtd.mtd_attributes} + Pstr_modtype {pmtd_name=mtd.mtd_name; pmtd_type=option untype_module_type mtd.mtd_type; + pmtd_loc=mtd.mtd_loc;pmtd_attributes=mtd.mtd_attributes;} | Tstr_open (ovf, _path, lid, attrs) -> Pstr_open (ovf, lid, attrs) | Tstr_class list -> Pstr_class (List.map (fun (ci, _, _) -> @@ -106,6 +107,7 @@ and untype_module_binding mb = pmb_name = mb.mb_name; pmb_expr = untype_module_expr mb.mb_expr; pmb_attributes = mb.mb_attributes; + pmb_loc = mb.mb_loc; } and untype_type_declaration decl = @@ -330,14 +332,15 @@ and untype_signature_item item = Psig_exception (untype_constructor_declaration decl) | Tsig_module md -> Psig_module {pmd_name = md.md_name; pmd_type = untype_module_type md.md_type; - pmd_attributes = md.md_attributes; + pmd_attributes = md.md_attributes; pmd_loc = md.md_loc; } | Tsig_recmodule list -> Psig_recmodule (List.map (fun md -> {pmd_name = md.md_name; pmd_type = untype_module_type md.md_type; - pmd_attributes = md.md_attributes}) list) + pmd_attributes = md.md_attributes; pmd_loc = md.md_loc}) list) | Tsig_modtype mtd -> - Psig_modtype {pmtd_name=mtd.mtd_name; pmtd_type=option untype_module_type mtd.mtd_type; pmtd_attributes=mtd.mtd_attributes} + Psig_modtype {pmtd_name=mtd.mtd_name; pmtd_type=option untype_module_type mtd.mtd_type; + pmtd_attributes=mtd.mtd_attributes; pmtd_loc=mtd.mtd_loc} | Tsig_open (ovf, _path, lid, attrs) -> Psig_open (ovf, lid, attrs) | Tsig_include (mty, _, attrs) -> Psig_include (untype_module_type mty, attrs) | Tsig_class list -> @@ -374,9 +377,10 @@ and untype_class_type_declaration cd = and untype_module_type mty = let desc = match mty.mty_desc with Tmty_ident (_path, lid) -> Pmty_ident (lid) + | Tmty_alias (_path, lid) -> Pmty_alias (lid) | Tmty_signature sg -> Pmty_signature (untype_signature sg) | Tmty_functor (_id, name, mtype1, mtype2) -> - Pmty_functor (name, untype_module_type mtype1, + Pmty_functor (name, Misc.may_map untype_module_type mtype1, untype_module_type mtype2) | Tmty_with (mtype, list) -> Pmty_with (untype_module_type mtype, @@ -405,7 +409,7 @@ and untype_module_expr mexpr = Tmod_ident (_p, lid) -> Pmod_ident (lid) | Tmod_structure st -> Pmod_structure (untype_structure st) | Tmod_functor (_id, name, mtype, mexpr) -> - Pmod_functor (name, untype_module_type mtype, + Pmod_functor (name, Misc.may_map untype_module_type mtype, untype_module_expr mexpr) | Tmod_apply (mexp1, mexp2, _) -> Pmod_apply (untype_module_expr mexp1, untype_module_expr mexp2) |
