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

Commit

Permalink
Handle capnames of subcaptures properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Oct 17, 2009
1 parent 6c418a8 commit 2c73bfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Regex/P6Regex/Actions.pm
Expand Up @@ -448,7 +448,11 @@ sub capnames($ast, $count) {
}
elsif $pasttype eq 'subcapture' {
if $ast.name eq '0' || $ast.name > 0 { $count := $ast.name + 1; }
%capnames{$ast.name} := 1;
my %x := capnames($ast[0], $count);
for %x {
%capnames{$_} := +%capnames{$_} + %x{$_};
}
$count := %x{''};
}
elsif $pasttype eq 'quant' {
Expand Down

0 comments on commit 2c73bfa

Please sign in to comment.