Permalink
Browse files

[GGE::Perl6Regex] aliased subrule

  • Loading branch information...
1 parent d7dffe3 commit 73a4257aaee5bcd2b6b060e66e67b3b6c4896982 @masak committed Jan 26, 2010
Showing with 8 additions and 3 deletions.
  1. +7 −2 lib/GGE/Perl6Regex.pm
  2. +1 −1 t/perl6regex/01-regex.t
View
@@ -258,13 +258,18 @@ class GGE::Perl6Regex {
$m.hash-access('iszerowidth') = True;
}
my ($subname, $pos) = parse_subname($target, $mob.to);
- $m.hash-access('subname') = $subname;
+ my $cname = $subname;
+ if $target.substr($pos, 1) eq '=' {
+ ++$pos;
+ ($subname, $pos) = parse_subname($target, $pos);
+ }
if $target.substr($pos, 1) eq '>' {
++$pos;
$m.to = $pos;
$m.hash-access('iscapture') = True;
- $m.hash-access('cname') = q['] ~ $subname ~ q['];
}
+ $m.hash-access('subname') = $subname;
+ $m.hash-access('cname') = q['] ~ $cname ~ q['];
return $m;
}
View
@@ -7,12 +7,12 @@ my %cached;
sub dirname($path) { $path.comb(/<-[/]>+ '/'/).join() } #' (vim fix)
my @test-files = <
- captures
metachars
quantifiers
backtrack
charclass
modifiers
+ captures
subrules
>;

0 comments on commit 73a4257

Please sign in to comment.