Skip to content

Commit

Permalink
Add OCaml 5.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Sep 26, 2024
1 parent 1268719 commit c3227d1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/api/ppx_deriving.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,18 @@ let raise_errorf ?sub ?loc fmt =
#if OCAML_VERSION >= (4, 08, 0)
let sub =
let msg_of_error err =
#if OCAML_VERSION >= (5, 3, 0)
let loc = err.Location.main.loc in
let print_report fmt x =
Ocaml_common.Format_doc.deprecated_printer
(fun fmt -> Location.print_report fmt x) fmt
in
Location.msg ~loc "%a" print_report err
#else
{ txt = (fun fmt -> Location.print_report fmt err);
loc = err.Location.main.loc } in
loc = err.Location.main.loc }
#endif
in
Option.map (List.map msg_of_error) sub in
#endif
let err = Location.error ?sub ?loc str in
Expand Down

0 comments on commit c3227d1

Please sign in to comment.