diff --git a/jscomp/core/dune b/jscomp/core/dune index c10a92ccab..cc9869706d 100644 --- a/jscomp/core/dune +++ b/jscomp/core/dune @@ -2,7 +2,7 @@ (name melangelib) (flags (:standard -open Melange_compiler_libs)) - (modules_without_implementation js_op) + (modules_without_implementation js_op j) (libraries ext melange_compiler_libs melange_ffi ppxlib.ast dune-build-info)) (rule @@ -37,7 +37,7 @@ (rule (targets js_record_iter.ml) - (deps j.ml) + (deps j.mli) (action (with-stdout-to %{targets} @@ -45,7 +45,7 @@ (rule (targets js_record_map.ml) - (deps j.ml) + (deps j.mli) (action (with-stdout-to %{targets} @@ -53,7 +53,7 @@ (rule (targets js_record_fold.ml) - (deps j.ml) + (deps j.mli) (action (with-stdout-to %{targets} diff --git a/jscomp/core/gen/gen_traversal.ml b/jscomp/core/gen/gen_traversal.ml index 33ad2391f7..03b79069b3 100644 --- a/jscomp/core/gen/gen_traversal.ml +++ b/jscomp/core/gen/gen_traversal.ml @@ -11,7 +11,7 @@ let parse fname = end in In_ch.with_file fname ~f:(fun ch -> let lexbuf = Lexing.from_channel ch in - let ast = Parse.implementation lexbuf in + let ast = Parse.interface lexbuf in ast) let write_ast oc ~input_name ast = diff --git a/jscomp/core/gen/node_types.ml b/jscomp/core/gen/node_types.ml index 0b38038a29..9be178721a 100644 --- a/jscomp/core/gen/node_types.ml +++ b/jscomp/core/gen/node_types.ml @@ -50,12 +50,12 @@ let isSupported (def : Longident.t) names = else `no | _ -> `no -let get_type_defs (ast : Parsetree.structure) = +let get_type_defs (ast : Parsetree.signature) = let types_with_deriving_definitions, deriving_attrs = List.filter_map - ~f:(fun { Parsetree.pstr_desc; _ } -> - match pstr_desc with - | Pstr_type (_, tdcls) -> ( + ~f:(fun { Parsetree.psig_desc; _ } -> + match psig_desc with + | Psig_type (_, tdcls) -> ( match List.rev tdcls with | [] -> None | { ptype_attributes = []; _ } :: _ -> None diff --git a/jscomp/core/j.ml b/jscomp/core/j.mli similarity index 100% rename from jscomp/core/j.ml rename to jscomp/core/j.mli