Skip to content

Commit

Permalink
Correct construction of capnames in P5Regex
Browse files Browse the repository at this point in the history
We got it totally wrong for anything quantified, and never noticed
before because we didn't really use this information.
  • Loading branch information
jnthn committed Jun 10, 2019
1 parent d7ab1e7 commit 9d14819
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/QRegex/P5Regex/Actions.nqp
Expand Up @@ -439,8 +439,9 @@ class QRegex::P5Regex::Actions is HLL::Actions {
$count := %x{''};
}
elsif $rxtype eq 'quant' {
my %astcap := capnames($ast[0], $count);
$count := %astcap{''};
my %x := capnames($ast[0], $count);
for %x { %capnames{$_.key} := nqp::add_i((%capnames{$_.key} // 0), $_.value); }
$count := %x{''};
}
%capnames{''} := $count;
nqp::deletekey(%capnames, '$!from');
Expand Down

0 comments on commit 9d14819

Please sign in to comment.