From: Eric S. Raymond Date: Tue, 29 Jun 2004 23:43:33 +0000 (+0000) Subject: Count line numbers correctly. X-Git-Tag: 1.0~4 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=d14931eeefac88500ef128a1abf0aa9c55640d24;p=mad.git Count line numbers correctly. --- diff --git a/lex.py b/lex.py index b2d9f40..3843379 100644 --- 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: