Skip to content

Commit

Permalink
improve message
Browse files Browse the repository at this point in the history
  • Loading branch information
gares committed Dec 2, 2023
1 parent c799de8 commit 84745ad
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/coq_elpi_builtins_synterp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,18 @@ module SynterpAction = struct
| Some action -> ignore @@ replay1 action state; replay state

let wrong_synterp_action x a =
synterp_interp_error Pp.(str "The elpi program did perform" ++ spc () ++ pp_action a ++ spc () ++
str" at parsing time, while at execution time it tried to perform" ++ spc () ++ str x ++ str(". "^common_err))
synterp_interp_error Pp.(str "At parsing time, the program did perform action:" ++ fnl () ++
pp_action a ++ fnl () ++
str"while at execution time it tried to perform action:" ++ fnl () ++
str x ++ fnl () ++
strbrk common_err)
let check_inconsistent_synterp_action eq ppx ppy x y a =
if not (eq x y) then
synterp_interp_error Pp.(str "The elpi program did perform" ++ spc () ++ pp_action a ++ spc () ++
str" at parsing time and execution, but on different inputs" ++ spc () ++ ppx x ++ str " != " ++ ppy y ++ str(". "^common_err))
synterp_interp_error Pp.(str "The program did perform action:" ++ fnl () ++
pp_action a ++ fnl () ++
str"at both parsing and execution time, but on different inputs:" ++ fnl () ++
ppx x ++ str " != " ++ ppy y ++ fnl () ++
strbrk common_err)

let check_inconsistent_synterp_action_string =
check_inconsistent_synterp_action (=) Pp.str Pp.str
Expand Down

0 comments on commit 84745ad

Please sign in to comment.