From: Armin Ronacher Date: Tue, 29 May 2007 22:57:49 +0000 (+0200) Subject: [svn] fixed a lexer error reporting issue X-Git-Tag: 2.0rc1~306 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=720e55b2962d6c3b5f34d77e8b4b537156692b2e;p=jinja2.git [svn] fixed a lexer error reporting issue --HG-- branch : trunk --- diff --git a/jinja/lexer.py b/jinja/lexer.py index d761d54..45398db 100644 --- a/jinja/lexer.py +++ b/jinja/lexer.py @@ -73,8 +73,8 @@ class Failure(object): self.message = message self.error_class = cls - def __call__(self, lineno): - raise self.error_class(self.message, lineno) + def __call__(self, lineno, filename): + raise self.error_class(self.message, lineno, filename) class LexerMeta(type): @@ -276,7 +276,7 @@ class Lexer(object): continue # failure group elif isinstance(token, Failure): - raise token(m.start(idx + 1)) + raise token(lineno, filename) # bygroup is a bit more complex, in that case we # yield for the current token the first named # group that matched