Skip to content

Commit c0f5b5f

Browse files
committed
Move Location to Mlx_shim
1 parent c6eb1a1 commit c0f5b5f

File tree

4 files changed

+2295
-2290
lines changed

4 files changed

+2295
-2290
lines changed

mlx/location.ml

Lines changed: 0 additions & 16 deletions
This file was deleted.

mlx/mlx_shim.ml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,25 @@ end
77
module Location = struct
88
include Location
99

10-
let mkloc txt loc = { Location.txt; loc }
11-
let mknoloc txt = { Location.txt; loc = Location.none }
10+
type error = Ppxlib.Location.Error.t
11+
12+
let mkloc txt loc = { txt; loc }
13+
let mknoloc txt = { txt; loc = none }
14+
let input_name = Ocaml_common.Location.input_name
15+
let curr = Ocaml_common.Location.curr
16+
17+
let error ?(loc = none) ?(sub = []) ?footnote:_ msg =
18+
Ppxlib.Location.Error.make ~loc ~sub msg
19+
20+
let errorf ?loc ?sub ?footnote:_ fmt =
21+
Format.kasprintf (error ?loc ?sub) fmt
22+
23+
let msg ?(loc = none) fmt = Format.kasprintf (fun msg -> loc, msg) fmt
24+
let deprecated = Ocaml_common.Location.deprecated
25+
let error_of_exn = Ocaml_common.Location.error_of_exn
26+
let print_report = Ocaml_common.Location.print_report
27+
let register_error_of_exn = Ppxlib.Location.Error.register_error_of_exn
28+
let prerr_warning = Ocaml_common.Location.prerr_warning
1229
end
1330

1431
module Longident = struct

0 commit comments

Comments
 (0)