Skip to content

Commit

Permalink
fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jchavarri committed Jun 5, 2023
1 parent dc56afc commit 529df6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
6 changes: 0 additions & 6 deletions bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
(modules melppx)
(libraries melange.ppx ppxlib))

(test
(name ounit_tests_main)
(package melange)
(modules ounit_tests_main)
(libraries ounit2 ounit_tests))

(executable
(name jsoo_main)
(modules jsoo_main jsoo_common)
Expand Down
18 changes: 13 additions & 5 deletions bin/jsoo_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ let error_of_exn e =
| Some (`Ok e) -> Some e
| Some `Already_displayed | None -> None

module Convert =
Ppxlib_ast.Convert
(Ppxlib_ast__.Versions.OCaml_414)
(Ppxlib_ast__.Versions.OCaml_current)

let compile impl str : Js.Unsafe.obj =
let modulename = "Test" in
(* let env = !Toploop.toplevel_env in *)
Expand All @@ -59,11 +64,14 @@ let compile impl str : Js.Unsafe.obj =
try
(* default *)
let ast = impl (Lexing.from_string str) in
let ast = Js_implementation.Ppx_entry.rewrite_implementation ast in
let ast =
Melange_ppxlib_ast.Of_ppxlib.copy_structure
(Ppxlib.Driver.map_structure
(Melange_ppxlib_ast.To_ppxlib.copy_structure ast))
let ast : Melange_compiler_libs.Parsetree.structure =
let ppxlib_ast : Ppxlib_ast__.Versions.OCaml_414.Ast.Parsetree.structure =
Obj.magic (ast : Melange_compiler_libs.Parsetree.structure)
in
let converted =
Convert.copy_structure (Ppxlib.Driver.map_structure ppxlib_ast)
in
(Obj.magic converted : Melange_compiler_libs.Parsetree.structure)
in
let typed_tree =
let { Typedtree.structure; coercion; shape = _; signature }, _finalenv =
Expand Down

0 comments on commit 529df6a

Please sign in to comment.