Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Add error message on incorrect range quantifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Nov 24, 2009
1 parent fb49c3e commit fafe401
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Regex/P6Regex/Grammar.pm
Expand Up @@ -56,8 +56,15 @@ grammar Regex::P6Regex::Grammar is HLL::Grammar;
token quantifier:sym<**> {
<sym> \s* <backmod> \s*
[
|| $<min>=[\d+] [ '..' $<max>=[\d+|'*'] ]?
|| <quantified_atom>
|| $<min>=[\d+]
[ '..'
$<max>=[
|| \d+
|| '*'
|| <.panic: "Only integers or '*' allowed as range quantifier endpoint">
]
]?
|| <quantified_atom>
]
}

Expand Down

0 comments on commit fafe401

Please sign in to comment.