Skip to content

Commit bc537f3

Browse files
committed
Fix bug with integer ** quantifiers
/ a ** 2_0 / previously matched "a" two times. Now uses the .ast of <decint>.
1 parent 7b79b2f commit bc537f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/QRegex/P6Regex/Actions.nqp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,10 @@ class QRegex::P6Regex::Actions is HLL::Actions {
127127

128128
method quantifier:sym<**>($/) {
129129
my $qast;
130-
$qast := QAST::Regex.new( :rxtype<quant>, :min(+$<min>), :max(-1), :node($/) );
131-
if ! $<max> { $qast.max(+$<min>) }
132-
elsif $<max> ne '*' { $qast.max(+$<max>); }
130+
my $min := $<min>.ast;
131+
$qast := QAST::Regex.new( :rxtype<quant>, :min($min), :max(-1), :node($/) );
132+
if ! $<max> { $qast.max($min) }
133+
elsif $<max> ne '*' { $qast.max($<max>.ast); }
133134
make backmod($qast, $<backmod>);
134135
}
135136

0 commit comments

Comments
 (0)