Skip to content

Commit

Permalink
Merge pull request #288 from kit-ty-kate/ocaml-5.3
Browse files Browse the repository at this point in the history
Add OCaml 5.3 support
  • Loading branch information
NathanReb authored Oct 4, 2024
2 parents 1268719 + c3227d1 commit fd3bcdc
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 fd3bcdc

Please sign in to comment.