aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/qparser/expression_parser.messages6
-rw-r--r--test/syntax_error.ml12
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/qparser/expression_parser.messages b/lib/qparser/expression_parser.messages
index 6bf33d9..6d32f16 100644
--- a/lib/qparser/expression_parser.messages
+++ b/lib/qparser/expression_parser.messages
@@ -112,3 +112,9 @@ main: LOCATION_START EOL FUNCTION L_PAREN IDENT COMA IDENT EOL
Unclosed `(`
+main: LOCATION_START EOL IDENT PLUS STAR
+main: LOCATION_START EOL IDENT DIV STAR
+main: LOCATION_START EOL IDENT STAR STAR
+main: LOCATION_START EOL IDENT MINUS STAR
+
+ Unknown operator. Did you write '+ =' instead of '+=' ?
diff --git a/test/syntax_error.ml b/test/syntax_error.ml
index f65042a..5587908 100644
--- a/test/syntax_error.ml
+++ b/test/syntax_error.ml
@@ -248,6 +248,17 @@ let unclosed_act () =
If there are nested blocks, the error will points the highest block.";
}
+let unknown_operator () =
+ _test_instruction
+ {|
+ variable + = 1
+|}
+ {
+ level = Error;
+ loc = _position;
+ message = "Unknown operator. Did you write '+ =' instead of '+=' ?";
+ }
+
let test =
( "Syntax Errors",
[
@@ -268,4 +279,5 @@ let test =
Alcotest.test_case "Misplaced if" `Quick misplaced_if;
Alcotest.test_case "(()" `Quick unclosed_paren2;
Alcotest.test_case "act: else" `Quick unclosed_act;
+ Alcotest.test_case "+ =" `Quick unknown_operator;
] )