aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/qparser/expression_parser.messages5
-rw-r--r--test/syntax_error.ml15
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/qparser/expression_parser.messages b/lib/qparser/expression_parser.messages
index 264e37d..6bf33d9 100644
--- a/lib/qparser/expression_parser.messages
+++ b/lib/qparser/expression_parser.messages
@@ -36,6 +36,10 @@ main: LOCATION_START EOL IF IDENT COLUMN EOL ELSE EOL LOCATION_END
A block starting with `IF` is not closed by `END`
If there are nested blocks, the error will points the highest block.
+main: LOCATION_START EOL ACT IDENT COLUMN EOL IDENT AMPERSAND LOCATION_END
+
+ A block starting with `ACT` is not closed by `END`
+
main: LOCATION_START EOL IDENT AMPERSAND END
Unexpected `END`.
@@ -107,3 +111,4 @@ main: LOCATION_START EOL ACT IDENT COLUMN EOL END TEXT_MARKER
main: LOCATION_START EOL FUNCTION L_PAREN IDENT COMA IDENT EOL
Unclosed `(`
+
diff --git a/test/syntax_error.ml b/test/syntax_error.ml
index 66f442d..f65042a 100644
--- a/test/syntax_error.ml
+++ b/test/syntax_error.ml
@@ -234,6 +234,20 @@ iif(1,0,0 + iif(1, 1, 2)
|}
{ level = Error; loc = _position; message = "Unclosed `(`" }
+let unclosed_act () =
+ _test_instruction {|
+ act 'Smthg':
+ else
+ end
+ end|}
+ {
+ level = Error;
+ loc = _position;
+ message =
+ "A block starting with `ACT` is not closed by `END`\n\
+ If there are nested blocks, the error will points the highest block.";
+ }
+
let test =
( "Syntax Errors",
[
@@ -253,4 +267,5 @@ let test =
Alcotest.test_case "Location change" `Quick location_change;
Alcotest.test_case "Misplaced if" `Quick misplaced_if;
Alcotest.test_case "(()" `Quick unclosed_paren2;
+ Alcotest.test_case "act: else" `Quick unclosed_act;
] )