[svn] fixed a lexer error reporting issue
authorArmin Ronacher <armin.ronacher@active-4.com>
Tue, 29 May 2007 22:57:49 +0000 (00:57 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Tue, 29 May 2007 22:57:49 +0000 (00:57 +0200)
--HG--
branch : trunk

jinja/lexer.py

index d761d541bd6da52d5b10640ccd929a16d2a49d3d..45398db7c38433a468712a1187cdcb266d1fa13f 100644 (file)
@@ -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