summaryrefslogtreecommitdiffstats
path: root/parsing/syntaxerr.ml
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/syntaxerr.ml')
-rw-r--r--parsing/syntaxerr.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/parsing/syntaxerr.ml b/parsing/syntaxerr.ml
index 5c17a99a3..b19a382d4 100644
--- a/parsing/syntaxerr.ml
+++ b/parsing/syntaxerr.ml
@@ -17,6 +17,7 @@ open Format
type error =
Unclosed of Location.t * string * Location.t * string
| Expecting of Location.t * string
+ | Not_expecting of Location.t * string
| Applicative_path of Location.t
| Variable_in_scope of Location.t * string
| Other of Location.t
@@ -42,6 +43,10 @@ let report_error ppf = function
fprintf ppf
"%a@[Syntax error: %s expected.@]"
Location.print_error loc nonterm
+ | Not_expecting (loc, nonterm) ->
+ fprintf ppf
+ "%a@[Syntax error: %s not expected.@]"
+ Location.print_error loc nonterm
| Applicative_path loc ->
fprintf ppf
"%aSyntax error: applicative paths of the form F(X).t \
@@ -61,4 +66,5 @@ let location_of_error = function
| Applicative_path l
| Variable_in_scope(l,_)
| Other l
+ | Not_expecting (l, _)
| Expecting (l, _) -> l