diff options
Diffstat (limited to 'parsing/lexer.mll')
-rw-r--r-- | parsing/lexer.mll | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/parsing/lexer.mll b/parsing/lexer.mll index 8b34b2483..8aed03b2f 100644 --- a/parsing/lexer.mll +++ b/parsing/lexer.mll @@ -242,7 +242,15 @@ let report_error ppf = function | Literal_overflow ty -> fprintf ppf "Integer literal exceeds the range of representable \ integers of type %s" ty -;; + +let () = + Location.register_error_of_exn + (function + | Error (err, loc) -> + Some (Location.error_of_printer loc report_error err) + | _ -> + None + ) } |