Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[GGE::Perl6Regex] aliased subrule

  • Loading branch information...
commit 73a4257aaee5bcd2b6b060e66e67b3b6c4896982 1 parent d7dffe3
@masak authored
Showing with 8 additions and 3 deletions.
  1. +7 −2 lib/GGE/Perl6Regex.pm
  2. +1 −1  t/perl6regex/01-regex.t
View
9 lib/GGE/Perl6Regex.pm
@@ -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
2  t/perl6regex/01-regex.t
@@ -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
>;
Please sign in to comment.
Something went wrong with that request. Please try again.