]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Fix call argument parsing
authorKevin Brown <kevin@kevin-brown.com>
Fri, 15 May 2020 03:34:06 +0000 (23:34 -0400)
committerKevin Brown <kevin@kevin-brown.com>
Fri, 15 May 2020 03:34:06 +0000 (23:34 -0400)
This temporarily break how `{% call %}` blocks work when arguments
are passed into them because it did not work consistently before. It
only worked for a single argument being passed in because of how
conditional expressions stripped out the parentheses if they were
present. Now they are properly captured but the parser does not yet
put them into the correct location within the Jinja AST.

grammar.ebnf

index 949c1aae5a2c771569e523231f9c90c69dde808f..8a988c9dd828a4e30fa268e9428ffcf108943aaf 100644 (file)
@@ -55,7 +55,9 @@ block_expression_single
 \r
 block_start\r
     =\r
-    block_open !("end") name:IDENTIFIER {SP}* parameters:[ block_parameters ] {SP}* block_close\r
+    block_open !("end") name:IDENTIFIER [ "(" name_call_parameters:variable_accessor_call_parameters ")" ]\r
+    [ {SP}+ parameters:block_parameters ]\r
+    {SP}* block_close\r
     ;\r
 \r
 block_end\r