-
Notifications
You must be signed in to change notification settings - Fork 83
Allow multiple digits in repetitions for regular expressions #141
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
Comments
andreasabel
added a commit
to andreasabel/alex
that referenced
this issue
Jan 31, 2020
Previously, the `r{n,m}` and related forms were restricted to single digit numbers `n` and `m`. We fix this by recognizing numbers of > 1 digits as NUM token and adding rules to the regex parsing that also allows NUMs for `n` and `m`. Previously, only CHAR was allowed, which subsumes single digits.
simonmar
added a commit
that referenced
this issue
Feb 13, 2020
[ fixed #141 ] regex: allow arbitary repetitions
This was referenced Jan 22, 2022
andreasabel
added a commit
to andreasabel/alex
that referenced
this issue
Jan 23, 2022
…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.
Ericson2314
pushed a commit
to andreasabel/alex
that referenced
this issue
Jan 23, 2022
…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.
Ericson2314
pushed a commit
that referenced
this issue
Jan 23, 2022
…#202) 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: 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently Alex allows only a single digit in the number of repetitions for a regular expression.
So
$digit {9}
is OK, but$digit {10}
is a very confusing syntax error.The text was updated successfully, but these errors were encountered: