From d2151e3557667c0ea0cff5f41a5dc58b275f107f Mon Sep 17 00:00:00 2001 From: David Beazley Date: Wed, 28 May 2008 16:13:22 +0000 Subject: Bug fixes --- example/ansic/clex.py | 4 ++-- example/yply/ylex.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'example') diff --git a/example/ansic/clex.py b/example/ansic/clex.py index 7dc98cd..7ec6d32 100644 --- a/example/ansic/clex.py +++ b/example/ansic/clex.py @@ -143,12 +143,12 @@ t_CCONST = r'(L)?\'([^\\\n]|(\\.))*?\'' # Comments def t_comment(t): r'/\*(.|\n)*?\*/' - t.lineno += t.value.count('\n') + t.lexer.lineno += t.value.count('\n') # Preprocessor directive (ignored) def t_preprocessor(t): r'\#(.)*?\n' - t.lineno += 1 + t.lexer.lineno += 1 def t_error(t): print "Illegal character %s" % repr(t.value[0]) diff --git a/example/yply/ylex.py b/example/yply/ylex.py index 67d2354..84f2f7a 100644 --- a/example/yply/ylex.py +++ b/example/yply/ylex.py @@ -42,7 +42,7 @@ def t_SECTION(t): # Comments def t_ccomment(t): r'/\*(.|\n)*?\*/' - t.lineno += t.value.count('\n') + t.lexer.lineno += t.value.count('\n') t_ignore_cppcomment = r'//.*' @@ -95,7 +95,7 @@ def t_code_error(t): raise RuntimeError def t_error(t): - print "%d: Illegal character '%s'" % (t.lineno, t.value[0]) + print "%d: Illegal character '%s'" % (t.lexer.lineno, t.value[0]) print t.value t.lexer.skip(1) -- cgit v1.2.1