diff options
Diffstat (limited to 'lib/qparser')
-rw-r--r-- | lib/qparser/qsp_expression.mly | 6 | ||||
-rw-r--r-- | lib/qparser/tokens.mly | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/qparser/qsp_expression.mly b/lib/qparser/qsp_expression.mly index b470a88..9375701 100644 --- a/lib/qparser/qsp_expression.mly +++ b/lib/qparser/qsp_expression.mly @@ -34,7 +34,7 @@ op = binary_operator expr2 = expression { Analyzer.Expression.boperator $loc op expr1 expr2 } - | v = delimited(TEXT_MARKER, LITERAL, TEXT_MARKER) + | v = delimited(TEXT_MARKER, literal*, TEXT_MARKER) { Analyzer.Expression.literal $loc v } | i = INTEGER { Analyzer.Expression.integer $loc i } | v = variable { Analyzer.Expression.ident v } @@ -44,6 +44,10 @@ { (Analyzer.Expression.function_ $loc k arg) } +literal: + | v = LITERAL { Qsp_syntax.T.Text v } + | e = delimited(ENTER_EMBED, expression*, LEAVE_EMBED) + { Qsp_syntax.T.Expression e } unary_operator: | OBJ diff --git a/lib/qparser/tokens.mly b/lib/qparser/tokens.mly index 6b218ed..6612351 100644 --- a/lib/qparser/tokens.mly +++ b/lib/qparser/tokens.mly @@ -25,6 +25,7 @@ %token <string>LITERAL %token <string>INTEGER %token TEXT_MARKER +%token ENTER_EMBED LEAVE_EMBED %token COMMENT |