Skip to content

Commit

Permalink
use more of ppxlib, less of compiler-libs
Browse files Browse the repository at this point in the history
Ref: #8
  • Loading branch information
andreypopp committed Oct 19, 2024
1 parent d1547a6 commit 0c3e62f
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mlx/dune
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion mlx/jsx_helper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
16 changes: 16 additions & 0 deletions mlx/location.ml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions mlx/warnings.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include Ocaml_common.Warnings
3 changes: 1 addition & 2 deletions ocamlmerlin_mlx/dune
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@
mlx_kernel
merlin-lib.extend
merlin-lib.kernel
ppxlib
compiler-libs.common))
ppxlib))
2 changes: 1 addition & 1 deletion ocamlmerlin_mlx/ocaml/preprocess/jsx_helper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion ocamlmerlin_mlx/ocaml/utils/dune
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c3e62f

Please sign in to comment.