]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Add initial support for call accessors
authorKevin <kevin@kevin-brown.com>
Sun, 10 May 2020 16:02:28 +0000 (12:02 -0400)
committerKevin <kevin@kevin-brown.com>
Sun, 10 May 2020 16:02:28 +0000 (12:02 -0400)
This only currently supports call accessors that do not take any
parameters. For now it is hard-coded to have no parameters.

new_parser.py

index ac1edf91fd2f7cb5781033b35ae300b256d54d35..f540a0c2d91eaad587e465a6b49cdd63432a179f 100644 (file)
@@ -179,6 +179,10 @@ def parse_variable_accessor(node, ast):
     elif accessor_type == 'dot':\r
         accessor_node = nodes.Getattr()\r
         accessor_node.attr = ast['parameter']\r
+    elif accessor_type == 'call':\r
+        accessor_node = nodes.Call()\r
+        accessor_node.args = []\r
+        accessor_node.kwargs = []\r
 \r
     accessor_node.node = node\r
     accessor_node.ctx = "load"\r