diff options
| author | Chimrod <> | 2023-11-24 11:48:27 +0100 | 
|---|---|---|
| committer | Chimrod <> | 2023-11-24 11:48:27 +0100 | 
| commit | 41e740cd35892eee77d645dca7c5caf3b4d23fed (patch) | |
| tree | 1d6e1174e8ebcdb535a8f6ce499cc0107187d45e | |
| parent | 93247b7bd2eae629ee229a2d040618b668b0e30e (diff) | |
Added two error messages
| -rw-r--r-- | lib/qparser/expression_parser.messages | 2 | ||||
| -rw-r--r-- | test/syntax_error.ml | 12 | 
2 files changed, 14 insertions, 0 deletions
| diff --git a/lib/qparser/expression_parser.messages b/lib/qparser/expression_parser.messages index 23d0dc3..e15c3fd 100644 --- a/lib/qparser/expression_parser.messages +++ b/lib/qparser/expression_parser.messages @@ -281,6 +281,8 @@ Unexpected operator after `ELSE`  main: LOCATION_START EOL IDENT DECR INTEGER SET  main: LOCATION_START EOL SET IDENT DECR INTEGER SET  main: LOCATION_START EOL LET IDENT DECR INTEGER SET +main: LOCATION_START EOL KEYWORD INTEGER TEXT_MARKER +main: LOCATION_START EOL KEYWORD IDENT COMA INTEGER TEXT_MARKER  Missing separator between instructions diff --git a/test/syntax_error.ml b/test/syntax_error.ml index 08de384..d814cbe 100644 --- a/test/syntax_error.ml +++ b/test/syntax_error.ml @@ -158,6 +158,17 @@ ELSEIF 0:           instruction.";      } +let comment_as_operator () = +  let result = +    { +      level = Error; +      loc = _position; +      message = "Missing separator between instructions"; +    } +  in +  _test_instruction "gs 'a', 'b' ! target" result; +  _test_instruction "gs 'a' ! target" result +  let test =    ( "Syntax Errors",      [ @@ -172,4 +183,5 @@ let test =        Alcotest.test_case "Unknown function" `Quick unknow_function;        Alcotest.test_case "Inline elif" `Quick inline_elif;        Alcotest.test_case "Unclosed block" `Quick unclosed_block; +      Alcotest.test_case "Unclosed block" `Quick comment_as_operator;      ] ) | 
