-
Notifications
You must be signed in to change notification settings - Fork 82
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 #197 by only lexing numeric literals in multiplicity expressions. #202
Fix #197 by only lexing numeric literals in multiplicity expressions. #202
Conversation
Why is the new testcase failing with error |
@Ericson2314 , could you please review this solution attempt? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code/idea looks good, any idea for CI failures?
I am clueless. It also happened on your PR #200: https://github.com/simonmar/alex/runs/4911840593?check_suite_focus=true#step:22:132 Locally, on my machine, it works fine. If I locally delete |
I am having even finding the error in the CI log, you might be ahead of me there? |
Does clicking the links I pasted not work? |
OK sorry that does work, and while Control-F does poorly, github's log search for 197 works too so I can find it in both PRs. All good now. |
I found the bug: test file needs to be listed in cabal file to go in sdist. Will push fix in a second. |
…ssions. In issue haskell#141, multiplicity annotations in regexes where extended to the general, multi-digit case {nnn,mmm}. However, lexing numeric literals broke parsing of regexes like: 32|64 [01-89] The solution here is to only lex numeric literals in a special lexer state called `multiplicity` which is entered by the parser when parsing multiplicity braces {nnn,mmm}. This restores alex' handling of digits as characters in the non-multiplicity situations.
ad70394
to
0007350
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something we miss in alex
's testsuite is failing tests, like .x
files that should not parse. I am thinking of a variant of #141 a{1 3}
that we would almost have accepted.
@@ -97,6 +97,7 @@ extra-source-files: | |||
tests/issue_71.x | |||
tests/issue_119.x | |||
tests/issue_141.x | |||
tests/issue_197.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Would not have thought of this!
Fix #197 by only lexing numeric literals in multiplicity expressions.
In issue #141, multiplicity annotations in regexes where extended to the general, multi-digit case
{nnn,mmm}
. However, lexing numeric literals broke parsing of regexes like:The solution here is to only lex numeric literals in a special lexerstate called
multiplicity
which is entered by the parser when parsing multiplicity braces{nnn,mmm}
.This restores alex' handling of digits as characters in the non-multiplicity situations.