Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
- "4.14"
- "5.1"
- "5.2"
- "ocaml-base-compiler.5.3.0~beta2"
- "5.3"
- "5.4"

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: init
init:
opam switch create . 5.3.0 --no-install -y
opam switch create . 5.4.0 --no-install -y
opam install . --deps-only -y
opam install menhir.20201216 ocamlformat ocaml-lsp-server -y

Expand Down
11 changes: 10 additions & 1 deletion mlx/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
(name pp)
(package mlx)
(public_name mlx-pp)
(modules :standard \ mlx_shim)
(flags
(:standard -w -9-67 -open Astlib.Ast_501))
(:standard -w -9-67 -open Astlib -open Astlib.Ast_501 -open Mlx_shim))
(libraries ppxlib ocaml-compiler-libs.shadow mlx_shim))

(library
(name mlx_shim)
(package mlx)
(modules mlx_shim)
(flags
(:standard -w -9-67 -open Astlib -open Astlib.Ast_501))
(libraries ppxlib ocaml-compiler-libs.shadow))

(ocamllex lexer)
Expand Down
3 changes: 1 addition & 2 deletions mlx/jsx_helper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ let make_loc (startpos, endpos) =
Location.loc_ghost = false;
}

let mkloc txt loc = { Location.txt; loc }
let mkexp ~loc d = Exp.mk ~loc:(make_loc loc) d

let mkjsxexp ~loc:loc' e =
Expand Down Expand Up @@ -63,7 +62,7 @@ let make_jsx_element ~raise ~loc:_ ~tag ~end_tag ~props ~children () =
in
let props =
let prop_exp ~loc name =
let id = mkloc (Lident name) (make_loc loc) in
let id = Location.mkloc (Lident name) (make_loc loc) in
mkexp ~loc (Pexp_ident id)
in
List.map
Expand Down
21 changes: 21 additions & 0 deletions mlx/mlx_shim.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Pprintast = struct
include Pprintast

let tyvar = Compiler_pprintast.tyvar
end

module Location = struct
include Location

let mkloc txt loc = { Location.txt; loc }
let mknoloc txt = { Location.txt; loc = Location.none }
end

module Longident = struct
include Longident

let last = function
| Lident s -> s
| Ldot (_, s) -> s
| Lapply (_, _) -> Misc.fatal_error "Longident.last"
end
3 changes: 2 additions & 1 deletion mlx/pp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ let () =
match str with
| Ok str ->
let str = Conv.copy_structure str in
if !print_ml then Format.printf "%a@." Pprintast.structure str
if !print_ml then
Format.printf "%a@." Compiler_pprintast.structure str
else
let oc = stdout in
output_string oc
Expand Down
3 changes: 1 addition & 2 deletions ocamlmerlin_mlx/ocaml/preprocess/jsx_helper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ let make_loc (startpos, endpos) =
Location.loc_ghost = false;
}

let mkloc txt loc = { Location.txt; loc }
let mkexp ~loc d = Exp.mk ~loc:(make_loc loc) d

let mkjsxexp ~loc:loc' e =
Expand Down Expand Up @@ -64,7 +63,7 @@ let make_jsx_element ~raise ~loc:_ ~tag ~end_tag ~props ~children () =
in
let props =
let prop_exp ~loc name =
let id = mkloc (Lident name) (make_loc loc) in
let id = Location.mkloc (Lident name) (make_loc loc) in
mkexp ~loc (Pexp_ident id)
in
List.map
Expand Down