Permalink
Browse files

Fix for $<a>=[ <b>+ ] (masak)++

  • Loading branch information...
1 parent fd3c735 commit 68f80b85a709318e3baab9c87c569c2b998e118b @sorear committed Dec 29, 2011
Showing with 20 additions and 0 deletions.
  1. +14 −0 src/niecza
  2. +6 −0 test3.pl
View
@@ -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;
View
@@ -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.