Supprt simple inline set statements

This commit is contained in:
Kevin 2024-05-22 13:19:25 -04:00
parent fa3618f817
commit bea927e9b6

View File

@ -39,6 +39,7 @@ Jinja {
| statement_from
| statement_import
| statement_include
| statement_setInline
statement_block
= statementId_block sp identifier (sp contextModifier_scoped)? (sp contextModifier_required)?
@ -78,6 +79,15 @@ Jinja {
| listLiteral
| variableName
statement_setInline
= statementId_set sp variableName sp? equals sp? statementSet_value
statementSet_value
= stringLiteral
| variableName
| listLiteral
| explicitTupleLiteral
statement_setBlock
= statementId_set sp variableName (sp verticalBar sp filterExpression)*
@ -134,12 +144,19 @@ Jinja {
listLiteral_values = sp? (listLiteral_value sp? comma sp?)* listLiteral_value sp?
listLiteral_value
= stringLiteral
| explicitTupleLiteral
| variableName
stringLiteral = stringLiteral_single | stringLiteral_double
stringLiteral_single = quote_single (~quote_single any)* quote_single
stringLiteral_double = quote_double (~quote_double any)* quote_double
explicitTupleLiteral = parenthesis_left sp? tupleLiteral_values sp? parenthesis_right
tupleLiteral_values = (sp? tupleLiteral_value sp? comma sp?)* tupleLiteral_value
tupleLiteral_value
= stringLiteral
quote_single = "'"
quote_double = "\""