-
Notifications
You must be signed in to change notification settings - Fork 28
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
an infinite loop [token == 0 "" L (1, n)-(1, n-1)] #22
Comments
Yep, there's no infinite loop, now. However the behavior seems to be wrong:
There should be an error, IMHO. Expected behavior:
|
It should work if replace use this regex: |
Yes, it will work if I replace the character. However it should report an error <unmatcher text ":"> with "*" too, IMHO. There's no expression for ":", how this character was skipped?
|
@xaionaro you are right. Also, if input string is start from non matched char, it will panic.
|
@xaionaro ok I am going to take a look at this. I am still concerned about the correct behavior when matching the empty string. If you have an unmatchable character (like A third option is to disallow at compilation matching the empty string. What do you think? |
I'm as an user of this library would be happier if matching of empty strings will be forbidden (the third option). It will help me to write better code (on my side). Sorry for my English :) |
@xaionaro that seems reasonable. I will make a separate PR for that (and change the current one to not preserve progress). |
fixed by #23 |
Thank you :) |
This test-case will cause an infinite loop. Of course the code is incorrect anyway (character ":" would cause an error). But maybe
lexmachine
shouldn't go to an infinite loop and should report an error.The text was updated successfully, but these errors were encountered: