]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Support filters being call chained
authorKevin <kevin@kevin-brown.com>
Thu, 14 May 2020 03:04:32 +0000 (23:04 -0400)
committerKevin <kevin@kevin-brown.com>
Thu, 14 May 2020 03:04:32 +0000 (23:04 -0400)
Previously filters were not treated the same as variable, as a
result it was not possible to call the result of a filter. Since
filters are treated as regular variable and therefore can be called
any number of times, this change was necessary to allow them to be
parsed the same way.

grammar.ebnf

index 1939e5e0b4764842260e00af1f016751a25564eb..34b8897f27306f431d5b24c842a3d904f77c6630 100644 (file)
@@ -334,13 +334,8 @@ variable_filter
     "|" {SP}* @:filter\r
     ;\r
 filter =\r
-    name:IDENTIFIER\r
-    [arguments:filter_parameters]\r
-    ;\r
-\r
-filter_parameters\r
-    =\r
-    "(" @:variable_accessor_call_parameters ")"\r
+    variable:IDENTIFIER\r
+    accessors:{ variable_accessor_call }*\r
     ;\r
 \r
 comment_expression\r