diff options
author | Alain Frisch <alain@frisch.fr> | 2013-03-25 17:47:28 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2013-03-25 17:47:28 +0000 |
commit | fbde1f7e525bf77cf825aaf1bdd51f6ce4a667f9 (patch) | |
tree | e92d16669531685975954e11a965cba83cdfcb3a /tools | |
parent | 0b9347f482130b9c92c84ed2d0914c8a327d69fb (diff) | |
download | ocaml-fbde1f7e525bf77cf825aaf1bdd51f6ce4a667f9.tar.gz |
Align module and module type declarations between Parsetree and Typedtree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13443 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tast_iter.ml | 16 | ||||
-rw-r--r-- | tools/tast_iter.mli | 2 | ||||
-rw-r--r-- | tools/untypeast.ml | 19 |
3 files changed, 12 insertions, 25 deletions
diff --git a/tools/tast_iter.ml b/tools/tast_iter.ml index f9312df84a..3972bd15ee 100644 --- a/tools/tast_iter.ml +++ b/tools/tast_iter.ml @@ -177,12 +177,12 @@ let signature_item sub item = List.iter (fun (_id, _, decl) -> sub # type_declaration decl) list | Tsig_exception (_id, _, decl) -> sub # exception_declaration decl - | Tsig_module (_id, _, mtype) -> - sub # module_type mtype + | Tsig_module md -> + sub # module_type md.md_type | Tsig_recmodule list -> - List.iter (fun (_id, _, mtype) -> sub # module_type mtype) list - | Tsig_modtype (_id, _, mdecl) -> - sub # modtype_declaration mdecl + List.iter (fun md -> sub # module_type md.md_type) list + | Tsig_modtype mtd -> + opt (sub # module_type) mtd.mtd_type | Tsig_open _ -> () | Tsig_include (mty,_,_) -> sub # module_type mty | Tsig_class list -> @@ -191,11 +191,6 @@ let signature_item sub item = List.iter (sub # class_type_declaration) list | Tsig_attribute _ -> () -let modtype_declaration sub mdecl = - match mdecl with - | Tmodtype_abstract -> () - | Tmodtype_manifest mtype -> sub # module_type mtype - let class_description sub cd = sub # class_type cd.ci_expr @@ -362,7 +357,6 @@ class iter = object(this) method core_type = core_type this method exception_declaration = exception_declaration this method expression = expression this - method modtype_declaration = modtype_declaration this method module_expr = module_expr this method module_type = module_type this method package_type = package_type this diff --git a/tools/tast_iter.mli b/tools/tast_iter.mli index cc9bbcae44..ac6bba1e6e 100644 --- a/tools/tast_iter.mli +++ b/tools/tast_iter.mli @@ -28,7 +28,6 @@ class iter: object method core_type: core_type -> unit method exception_declaration: exception_declaration -> unit method expression: expression -> unit - method modtype_declaration: modtype_declaration -> unit method module_expr: module_expr -> unit method module_type: module_type -> unit method package_type: package_type -> unit @@ -65,7 +64,6 @@ val core_field_type: iter -> core_field_type -> unit val core_type: iter -> core_type -> unit val exception_declaration: iter -> exception_declaration -> unit val expression: iter -> expression -> unit -val modtype_declaration: iter -> modtype_declaration -> unit val module_expr: iter -> module_expr -> unit val module_type: iter -> module_type -> unit val package_type: iter -> package_type -> unit diff --git a/tools/untypeast.ml b/tools/untypeast.ml index f42592029f..45c3ed4afc 100644 --- a/tools/untypeast.ml +++ b/tools/untypeast.ml @@ -324,14 +324,14 @@ and untype_signature_item item = ) list) | Tsig_exception (_id, name, decl) -> Psig_exception (untype_exception_declaration name decl) - | Tsig_module (_id, name, mtype) -> - Psig_module {pmd_name = name; pmd_type = untype_module_type mtype; pmd_attributes = []} + | Tsig_module md -> + Psig_module {pmd_name = md.md_name; pmd_type = untype_module_type md.md_type; pmd_attributes = md.md_attributes} | Tsig_recmodule list -> - Psig_recmodule (List.map (fun (_id, name, mtype) -> - {pmd_name = name; pmd_type = untype_module_type mtype; - pmd_attributes = []}) list) - | Tsig_modtype (_id, name, mdecl) -> - Psig_modtype {pmtd_name=name; pmtd_type=untype_modtype_declaration mdecl; pmtd_attributes=[]} + 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) + | Tsig_modtype mtd -> + Psig_modtype {pmtd_name=mtd.mtd_name; pmtd_type=option untype_module_type mtd.mtd_type; pmtd_attributes=mtd.mtd_attributes} | Tsig_open (_path, lid, attrs) -> Psig_open (lid, attrs) | Tsig_include (mty, _lid, attrs) -> Psig_include (untype_module_type mty, attrs) | Tsig_class list -> @@ -345,11 +345,6 @@ and untype_signature_item item = psig_loc = item.sig_loc; } -and untype_modtype_declaration mdecl = - match mdecl with - Tmodtype_abstract -> None - | Tmodtype_manifest mtype -> Some (untype_module_type mtype) - and untype_class_description cd = { pci_virt = cd.ci_virt; |