Skip to content
Myr

[svn] improved generic "EOF while lexing" exception message so that it tells about unbalanced parentheses.

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 5b4e975 · Browse files · 1 file+9 added−4 removed
This commit

State

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

Diff stats

1 file+9 added−4 removed

  • other:+9 added−4 removed

1 file+9 added−4 removed

modified:jinja/lexer.py+9 added-4 removed
309 unmodified lines
310 balancing_stack.append(')')311 elif data == '[':312 balancing_stack.append(']')313 elif data in ('}', ')', ']'):314 if not balancing_stack or \315 balancing_stack.pop() != data:316 raise TemplateSyntaxError('unexpected EOF '317 'while lexing',314 if not balancing_stack:315 raise TemplateSyntaxError('unexpected "%s"' %316 data, lineno,317 filename)318 expected_op = balancing_stack.pop()319 if expected_op != data:320 raise TemplateSyntaxError('unexpected "%s", '321 'expected "%s"' %322 (data, expected_op),323 lineno, filename)324 # yield items325 if tokens is not None:326 if data:
47 unmodified lines