diff options
-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 2ba26fc..22ffd7d 100644 --- a/lib/qparser/expression_parser.messages +++ b/lib/qparser/expression_parser.messages @@ -116,3 +116,7 @@ dynamics: IDENT R_PAREN dynamics: TEXT_MARKER ENTER_EMBED FUNCTION_NOARGS TEXT_MARKER Unbalanced paren + +dynamics: IDENT PLUS FUNCTION_NOARGS TEXT_MARKER + + Missing operator before text diff --git a/test/syntax_error.ml b/test/syntax_error.ml index 99f324a..9d51cf3 100644 --- a/test/syntax_error.ml +++ b/test/syntax_error.ml @@ -284,6 +284,12 @@ let unexpected_bracket () = _test_instruction {|"<<a[]]>>"|} expected; _test_instruction "'<<rand(1,2))>>'" expected +let missing_operator () = + _test_instruction {| +'' + $func('f', '') '' +|} + { level = Error; loc = _position; message = "Missing operator before text" } + let test = ( "Syntax Errors", [ @@ -308,4 +314,5 @@ let test = Alcotest.test_case "+ =" `Quick unknown_operator; Alcotest.test_case "'<<''>>'" `Quick nested_string_mess; Alcotest.test_case "a[]]" `Quick unexpected_bracket; + Alcotest.test_case "Missing +" `Quick missing_operator; ] ) |