]> thyrsus.com Git - mad.git/commitdiff
Count line numbers correctly.
authorEric S. Raymond <esr@thyrsus,com>
Tue, 29 Jun 2004 23:43:33 +0000 (23:43 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Tue, 29 Jun 2004 23:43:33 +0000 (23:43 +0000)
lex.py

diff --git a/lex.py b/lex.py
index b2d9f40e121aa5e9da5848ba6c52adaf01bcd21d..38433792a4b286c4a3699c6343b5813fcce1e18c 100644 (file)
--- a/lex.py
+++ b/lex.py
@@ -8,7 +8,7 @@
 #
 # Copyright (C) 2001, David M. Beazley
 #
-# $Header: /home/esr/WWW/mad/RCS/lex.py,v 1.2 2004/01/20 20:39:32 esr Exp esr $
+# $Header: /home/esr/WWW/mad/RCS/lex.py,v 1.3 2004/01/27 08:37:17 esr Exp esr $
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -305,6 +305,8 @@ class Lexer:
                 tok = LexToken()
                 tok.value = m.group()
                 tok.lineno = self.lineno
+                if "\n" in lexignore:
+                    self.lineno += tok.value.count('\n')
                 tok.lexer = self
                 func,tok.type = self.lexindexfunc[i]
                 if not func: