diff options
Diffstat (limited to 'ext/ply/example/yply/ylex.py')
-rw-r--r-- | ext/ply/example/yply/ylex.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/ply/example/yply/ylex.py b/ext/ply/example/yply/ylex.py index 61bc0c7ef..84f2f7a73 100644 --- a/ext/ply/example/yply/ylex.py +++ b/ext/ply/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) @@ -104,9 +104,9 @@ lex.lex() if __name__ == '__main__': lex.runmain() + + + - - - - + |