]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Allow variable identifiers to be conditionals
authorKevin <kevin@kevin-brown.com>
Tue, 12 May 2020 01:08:06 +0000 (21:08 -0400)
committerKevin <kevin@kevin-brown.com>
Tue, 12 May 2020 01:08:06 +0000 (21:08 -0400)
This aligns with the Python behaviour and pre-existing Jinja behaviour
where a variable expression can be used as a test for a conditional.
This was necessary to allow variable identifiers to be used in places
which was expecting a possible conditional expression, like in a if/else
expression.

grammar.ebnf

index beaf0d3849144c43dbe43085af676e3dc2aeb659..f51d34ce70561eff64f90380e3e7be577d4e5f65 100644 (file)
@@ -222,6 +222,7 @@ conditional_expression
     | conditional_expression_logical\r
     | conditional_expression_comparator\r
     | conditional_expression_test\r
+    | variable_identifier\r
     ;\r
 \r
 conditional_expression_if\r