diff options
author | David Beazley <dave@dabeaz.com> | 2008-05-28 16:13:22 +0000 |
---|---|---|
committer | David Beazley <dave@dabeaz.com> | 2008-05-28 16:13:22 +0000 |
commit | d2151e3557667c0ea0cff5f41a5dc58b275f107f (patch) | |
tree | 70b685901d26af63ede13b37cba8f9c23433926c /example | |
parent | 241e3c771322a9d3014d2f0d48975f15bcba732a (diff) | |
download | ply-d2151e3557667c0ea0cff5f41a5dc58b275f107f.tar.gz |
Bug fixes
Diffstat (limited to 'example')
-rw-r--r-- | example/ansic/clex.py | 4 | ||||
-rw-r--r-- | example/yply/ylex.py | 4 |
2 files changed, 4 insertions, 4 deletions
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) |