Skip to content

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

Closed
yav opened this issue Jul 25, 2019 · 0 comments
Closed

Allow multiple digits in repetitions for regular expressions #141

yav opened this issue Jul 25, 2019 · 0 comments

Comments

@yav
Copy link

yav commented Jul 25, 2019

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.

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
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant