Skip to content

Commit

Permalink
Even if we captured nothing, we should still put empty RPAs into the …
Browse files Browse the repository at this point in the history
…caphash for quantified matches, so the match object gets the correct structure.
  • Loading branch information
jnthn committed Nov 19, 2011
1 parent db4f73c commit 3ff2502
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/QRegex/Cursor.nqp
Expand Up @@ -16,11 +16,11 @@ role NQPCursorRole {

method CAPHASH() {
my $caps := nqp::hash();
my %caplist := $!regexsub.nqpattr('caps');
for %caplist {
$caps{$_.key} := nqp::list() if $_.value >= 2;
}
if $!cstack {
my %caplist := $!regexsub.nqpattr('caps');
for %caplist {
$caps{$_.key} := nqp::list() if $_.value >= 2;
}
for $!cstack -> $subcur {
my $submatch := $subcur.MATCH;
for nqp::split('=', nqp::getattr($subcur, $?CLASS, '$!name')) -> $name {
Expand Down

0 comments on commit 3ff2502

Please sign in to comment.