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

Commit

Permalink
Add aliased assertion captures.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Oct 13, 2009
1 parent 032c58a commit 76c694d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Regex/P6Regex/Actions.pm
Expand Up @@ -244,8 +244,15 @@ method assertion:sym<method>($/) {

method assertion:sym<name>($/) {
my $name := ~$<longname>;
my $past := PAST::Regex.new( $name, :name($name) , :pasttype('subrule'),
:subtype('capture') );
my $past;
if $<assertion> {
$past := $<assertion>[0].ast;
$past.name($name);
}
else {
$past := PAST::Regex.new( $name, :name($name) , :pasttype('subrule'),
:subtype('capture') );
}
make $past;
}

Expand Down

0 comments on commit 76c694d

Please sign in to comment.