Skip to content

Commit 3c49975

Browse files
committed
Allow other integer representations for ranges in ** quantifier
1 parent 6fd6df9 commit 3c49975

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/QRegex/P6Regex/Grammar.nqp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar {
213213
token quantifier:sym<**> {
214214
<sym> <.normspace>? <backmod> <.normspace>?
215215
[
216-
| <.decint> \s+ '..' <.panic: "Spaces not allowed in bare range">
217-
| <min=.decint>
216+
| <.integer> \s+ '..' <.panic: "Spaces not allowed in bare range">
217+
| <min=.integer>
218218
[ '..'
219219
[
220-
| <max=.decint> {
220+
| <max=.integer> {
221221
$/.CURSOR.panic("Negative numbers are not allowed as quantifiers") if $<max>.Str < 0;
222222
}
223223
| $<max>=['*']

t/qregex/rx_quantifiers

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ a**2 baabaa y two "a" characters
168168
a**0..4 bbbbbbb y no "a" characters
169169
a**2..4 bababab n not two consecutive "a" characters
170170
a**2..4 baabbbb y two "a" characters
171+
a**0b10..0b100 baabbbb y two "a" characters (using binary representation)
171172
a**2..4 baaabbb y three "a" characters
172173
a**2..4 baaaabb y four "a" characters
173174
a**2..4 baaaaaa y four "a" characters

0 commit comments

Comments
 (0)