-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling yyless(n)
after input()
causes a character duplicated.
#547
Comments
Which flex options (if any) should we use to reproduce this? What do you expect to be on the input stream after yyless(0)? Thanks! This will help with adding regression tests to the suite! |
It need not be In the above example, after call to I have not used any flex options while reproducing the bug. |
Thanks! I understand. Last question: did this work differently in a previously released version of flex? (Just makes a difference in how the issue is categorized.) |
I haven't used flex much. Also, my codebase didn't contain |
Copy that. No worries. |
Glad to help. Related issue #395, in |
This sample scanner with input
ayz
should never match rule 2.But after matching 'a' inside rule 1, calling
input()
returns 'y'. It incrementsyy_c_buf_p
to point to 'z', and character atyy_c_buf_p
, i.e. 'z' intoyy_hold_char
. Butyyless
macro is using outdated variableyy_cp
to restore theyy_hold_char
, which replaces it in a different position essentially causing duplication of character held byyy_hold_char
.Now the buffer contains
azz
which would erroneously match rule 2.The text was updated successfully, but these errors were encountered: