Skip to content
Myr

[svn] added better test.py file for jinja1 and fixed python translator bug

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 9224452 · Browse files · 2 files+9 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+9 added−3 removed

  • other:+9 added−3 removed

2 files+9 added−3 removed

modified:jinja/translators/python.py+2 added-2 removed
199 unmodified lines
200 def handle_bitor(self, node):201 """202 We use the pipe operator for filtering.203 """204 return 'environment.apply_filters(%s, %r)' % (204 return 'environment.apply_filters(%s, [%s])' % (205 self.handle_node(node.nodes[0]),206 [self.handle_node(n) for n in node.nodes[1:]]206 ', '.join([self.handle_node(n) for n in node.nodes[1:]])207 )208209 def handle_call_func(self, node):210 """
141 unmodified lines
modified:test.py+7 added-1 removed
1from jinja.environment import Environment23e = Environment()45def test(x):5def test_lexer(x):6 for pos, token, data in e.lexer.tokenize(x):7 print '%-8d%-30r%-40r' % (pos, token, data)8910def test_parser(x):11 from jinja.parser import Parser12 from jinja.translators.python import translate13 print translate(e, Parser(e, x).parse())