Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
replace INDRULE with var carrying actual coderef
This is so that the nfa routines can call .NFA on the coderef to extract
the NFA and merge properly when <foo> refers to a lexical regex.
  • Loading branch information
TimToady committed Nov 16, 2014
1 parent f8f6feb commit 7137b21
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Perl6/Actions.nqp
Expand Up @@ -7505,11 +7505,14 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions {
$gref, QAST::SVal.new( :value($name) )),
:name(~$<longname>) );
} elsif $*W.regex_in_scope('&' ~ $name) {
my $coderef := $*W.find_symbol(['&' ~ $name]);
my $var := QAST::Var.new( :name('&' ~ $name), :scope<lexical> );
$var.annotate('coderef',$coderef);
my $c := $var.ann('coderef');
$qast := QAST::Regex.new(:rxtype<subrule>, :subtype<capture>,
:node($/), QAST::NodeList.new(
QAST::SVal.new( :value('INDRULE') ),
QAST::Var.new( :name('&' ~ $name), :scope('lexical') ) ),
:node($/), QAST::NodeList.new($var),
:name($name) );
# nqp::say($qast.dump);
}
else {
$qast := QAST::Regex.new(:rxtype<subrule>, :subtype<capture>,
Expand Down

0 comments on commit 7137b21

Please sign in to comment.