Skip to content

Commit

Permalink
be resilient to negative chars
Browse files Browse the repository at this point in the history
  • Loading branch information
gares committed Feb 10, 2025
1 parent bca6210 commit 671fb4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/elpi_trace_elaborator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ let int_of_string s =
let decode_loc s =
if Str.(string_match (regexp "File .(context step_id:\\([0-9]+\\))") s 0) then
`Context (int_of_string (Str.matched_group 1 s))
else if Str.(string_match (regexp "File .\\([^,]+\\)., line \\([0-9]+\\), column \\([0-9]+\\), characters? \\([0-9]+\\)-?[0-9]*") s 0) then
else if Str.(string_match (regexp "File .\\([^,]+\\)., line \\([0-9]+\\), column \\([0-9]+\\), characters? -*\\([0-9]+\\)-*[0-9]*") s 0) then
`File {
filename = Str.matched_group 1 s;
line = Str.matched_group 2 s |> int_of_string;
Expand Down

0 comments on commit 671fb4a

Please sign in to comment.