diff options
author | Chimrod <> | 2024-02-02 15:00:40 +0100 |
---|---|---|
committer | Chimrod <> | 2024-02-02 15:00:40 +0100 |
commit | e2bcf0a034b9c83b44158d299b2b255d328b17b0 (patch) | |
tree | d7e91c03a2fc01a8a6a9b273325d4cf9c6e42ff3 | |
parent | 3b5c4f8cc65a9b781ffdea09ee6b725fb8341d4d (diff) |
New specific error message
-rw-r--r-- | lib/qparser/expression_parser.messages | 4 | ||||
-rw-r--r-- | test/syntax_error.ml | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/qparser/expression_parser.messages b/lib/qparser/expression_parser.messages index 707597b..264e37d 100644 --- a/lib/qparser/expression_parser.messages +++ b/lib/qparser/expression_parser.messages @@ -103,3 +103,7 @@ main: LOCATION_START EOL IF IDENT COLUMN EOL END TEXT_MARKER main: LOCATION_START EOL ACT IDENT COLUMN EOL END TEXT_MARKER Unexpected instruction after `ACT` `END` block. + +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 490ec96..66f442d 100644 --- a/test/syntax_error.ml +++ b/test/syntax_error.ml @@ -228,6 +228,12 @@ end if|} (* The location name *) +let unclosed_paren2 () = + _test_instruction {| +iif(1,0,0 + iif(1, 1, 2) +|} + { level = Error; loc = _position; message = "Unclosed `(`" } + let test = ( "Syntax Errors", [ @@ -246,4 +252,5 @@ let test = Alcotest.test_case "Missing comparable" `Quick missing_comparable; Alcotest.test_case "Location change" `Quick location_change; Alcotest.test_case "Misplaced if" `Quick misplaced_if; + Alcotest.test_case "(()" `Quick unclosed_paren2; ] ) |