"""
We use the pipe operator for filtering.
"""
- return 'environment.apply_filters(%s, %r)' % (
+ return 'environment.apply_filters(%s, [%s])' % (
self.handle_node(node.nodes[0]),
- [self.handle_node(n) for n in node.nodes[1:]]
+ ', '.join([self.handle_node(n) for n in node.nodes[1:]])
)
def handle_call_func(self, node):
e = Environment()
-def test(x):
+def test_lexer(x):
for pos, token, data in e.lexer.tokenize(x):
print '%-8d%-30r%-40r' % (pos, token, data)
+
+
+def test_parser(x):
+ from jinja.parser import Parser
+ from jinja.translators.python import translate
+ print translate(e, Parser(e, x).parse())