-
Notifications
You must be signed in to change notification settings - Fork 119
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
Fix lexer rule to handle operator of format like operator + comment
#628
base: sail2
Are you sure you want to change the base?
Conversation
d03da2e
to
86193df
Compare
Test case looks good, I'll take a closer look at this next week and hopefully get it merged. |
f0bba3f
to
6ae0cc5
Compare
but they looks very repetitive and boring and even |
There should be a way to do this with just a slightly more sophisticated regex, and without adding extra lexing rules I think. Using
i.e. the logic is something like:
|
Probably the only way to gain confidence in such a regex would be to test it on all possible operator character sequences up to some bound. |
I've tested your regex with
also test on this, with no change:
but some test case failed:
The rules So if you prefer keep it as an error (rust do so), I can just delete the complex rules and only keep the brife
|
6ae0cc5
to
567c6f2
Compare
567c6f2
to
3e94824
Compare
Maybe we can just simplify the rules for operators slightly. We could:
|
I'm leaning towards option 2, as it's the most conservative and is still fairly easy to explain in the manual. |
I can think of the following cases right now:
So I think option 2 is ok, I guess it can cover (maybe) 99% cases |
try fix #627
Maybe fixed
the basic rule here is
then use it on both maybe_slash_start operator and no_slash_start operator trying to cover all
but I don't have a good way of checking the rules
Update
can't be handled correctly for now
Update