Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for $<a>=[ <b>+ ] (masak)++
  • Loading branch information
sorear committed Dec 29, 2011
1 parent fd3c735 commit 68f80b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/niecza
Expand Up @@ -25,6 +25,20 @@ use STD;
# }
# }

augment class RxOp::Capturing {
method used_caps() {
my %h = map { ($_ => $*in_quant ?? 2 !! 1) }, @$.captures;

for @$.zyg -> $k {
for $k.used_caps.pairs -> $p {
%h{$p.key} = (%h{$p.key} // 0) + $p.value;
}
}

%h
}
}

augment class Op::ImmedForLoop {
method code_labelled($body, $l) {
my $id = ::GLOBAL::NieczaActions.genid;
Expand Down
6 changes: 6 additions & 0 deletions test3.pl
Expand Up @@ -34,3 +34,9 @@
"/hello/bug" ~~ $reg;
is $/<hello>[0], 'bug', '<foo=$bar> works';
}

# http://irclog.perlgeek.de/perl6/2011-12-29#i_4894154
{
"ab" ~~ / $<a>=[ <alpha>+ ] /;
is $<alpha>[1], "b", "<foo>+ inside string capture works";
}

0 comments on commit 68f80b8

Please sign in to comment.