diff --git a/mlx/dune b/mlx/dune index 3c20f61..18f4b37 100644 --- a/mlx/dune +++ b/mlx/dune @@ -4,7 +4,7 @@ (public_name mlx-pp) (flags (:standard -w -9-67 -open Astlib.Ast_501)) - (libraries ppxlib compiler-libs.common)) + (libraries ppxlib ocaml-compiler-libs.shadow)) (ocamllex lexer) diff --git a/mlx/jsx_helper.ml b/mlx/jsx_helper.ml index b83d110..bceb76e 100644 --- a/mlx/jsx_helper.ml +++ b/mlx/jsx_helper.ml @@ -11,7 +11,7 @@ let make_loc (startpos, endpos) = Location.loc_ghost = false; } -let mkloc = Location.mkloc +let mkloc txt loc = { Location.txt; loc } let mkexp ~loc d = Exp.mk ~loc:(make_loc loc) d let mkjsxexp ~loc:loc' e = diff --git a/mlx/location.ml b/mlx/location.ml new file mode 100644 index 0000000..04024f3 --- /dev/null +++ b/mlx/location.ml @@ -0,0 +1,16 @@ +include Ppxlib.Location + +type error = Error.t + +let mkloc txt loc = { txt; loc } +let mknoloc txt = { txt; loc = none } +let input_name = Ocaml_common.Location.input_name +let curr = Ocaml_common.Location.curr +let error ?(loc=none) ?(sub=[]) ?footnote:_ msg = Error.make ~loc ~sub msg +let errorf ?loc ?sub ?footnote:_ fmt = Format.kasprintf (error ?loc ?sub) fmt +let msg ?(loc=none) fmt = Format.kasprintf (fun msg -> loc, msg) fmt +let deprecated = Ocaml_common.Location.deprecated +let error_of_exn = Ocaml_common.Location.error_of_exn +let print_report = Ocaml_common.Location.print_report +let register_error_of_exn = Error.register_error_of_exn +let prerr_warning = Ocaml_common.Location.prerr_warning diff --git a/mlx/warnings.ml b/mlx/warnings.ml new file mode 100644 index 0000000..7c50982 --- /dev/null +++ b/mlx/warnings.ml @@ -0,0 +1 @@ +include Ocaml_common.Warnings diff --git a/ocamlmerlin_mlx/dune b/ocamlmerlin_mlx/dune index 57d7287..551ed6e 100644 --- a/ocamlmerlin_mlx/dune +++ b/ocamlmerlin_mlx/dune @@ -13,5 +13,4 @@ mlx_kernel merlin-lib.extend merlin-lib.kernel - ppxlib - compiler-libs.common)) + ppxlib)) diff --git a/ocamlmerlin_mlx/ocaml/preprocess/jsx_helper.ml b/ocamlmerlin_mlx/ocaml/preprocess/jsx_helper.ml index 4927f78..60875b5 100644 --- a/ocamlmerlin_mlx/ocaml/preprocess/jsx_helper.ml +++ b/ocamlmerlin_mlx/ocaml/preprocess/jsx_helper.ml @@ -12,7 +12,7 @@ let make_loc (startpos, endpos) = Location.loc_ghost = false; } -let mkloc = Location.mkloc +let mkloc txt loc = { Location.txt; loc } let mkexp ~loc d = Exp.mk ~loc:(make_loc loc) d let mkjsxexp ~loc:loc' e = diff --git a/ocamlmerlin_mlx/ocaml/utils/dune b/ocamlmerlin_mlx/ocaml/utils/dune index 3d41eb7..0c4e6c0 100644 --- a/ocamlmerlin_mlx/ocaml/utils/dune +++ b/ocamlmerlin_mlx/ocaml/utils/dune @@ -2,7 +2,7 @@ (name mlx_ocaml_utils) (package ocamlmerlin-mlx) (flags :standard -w=-9-67-69 -open=Mlx_utils -open Astlib.Ast_501) - (libraries ppxlib compiler-libs.common merlin-lib.config mlx_utils)) + (libraries ppxlib merlin-lib.config mlx_utils)) (copy_files (enabled_if