]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Fix grammar parsing for block separators
authorKevin Brown <kevin@kevin-brown.com>
Fri, 15 May 2020 22:03:35 +0000 (18:03 -0400)
committerKevin Brown <kevin@kevin-brown.com>
Fri, 15 May 2020 22:03:35 +0000 (18:03 -0400)
Previously this allows blocks to be separated by commas and have one
trailing off. Now this only allows blocks to be properly separated
by commas and trailing comms are no longer allowed. This also now
enforces that when parameters are not separated by commas, they are
spearated by at least one space.

grammar.ebnf

index 127f567579a7ae3bc41bbfa7523eff6a69d42118..b1e2295d05c41b0bb216c3031aff2e9b2a3beff5 100644 (file)
@@ -126,14 +126,18 @@ implicit_identifier_tuple
 block_parameters\r
     =\r
     @+:block_parameter\r
-    [ {SP}* "," ]\r
     {\r
-        {SP}*\r
+        block_parameter_separator\r
         @+:block_parameter\r
-        [ {SP}* "," ]\r
      }*\r
     ;\r
 \r
+block_parameter_separator\r
+    =\r
+    | ( {SP}* "," {SP}* )\r
+    | ( {SP}+ )\r
+    ;\r
+\r
 block_parameter\r
     =\r
     | block_parameter_key_value\r