What steps will reproduce the problem?
1. Run 'python ply_bug.py' (see attachment).
---
What is the expected output? What do you see instead?
The expected output is to have the line number the same each time, as we
parse the same input. However, it seems the line number is not reset each time.
---
What version of the product are you using? On what operating system?
Ply 3.3 on Linux.
---
Please provide any additional information below.
I included a patch (lex_bugfix.patch attachment) that resets the lineno
attribute of the lexer each time the input is set. If you apply the patch
and rerun the example, you will see that the line number of the parse error
is the same each time.
Also note that the lexpos attribute of the lexer is properly reset in the
input() function.
Original issue reported on code.google.com by d.hendr...@tue.nl on 8 Apr 2010 at 6:05
Original issue reported on code.google.com by
d.hendr...@tue.nl
on 8 Apr 2010 at 6:05Attachments: