Skip to content

Commit

Permalink
A few changes needed by qast_restructure in NQP.
Browse files Browse the repository at this point in the history
Only one known regressions remains, which is related to compile-time
inlining of multis.
  • Loading branch information
jnthn committed Aug 7, 2014
1 parent 6117d54 commit 1f4cae6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Perl6/Actions.nqp
Expand Up @@ -4655,7 +4655,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
$has_stuff := 0;
}
elsif $stmts == 1 {
my $elem := $past.ann('past_block')[1][0][0];
my $elem := try $past.ann('past_block')[1][0][0];
$elem := $elem[0] if $elem ~~ QAST::Want;
if $elem ~~ QAST::Op && $elem.name eq '&infix:<,>' {
# block contains a list, so test the first element
Expand Down Expand Up @@ -7270,7 +7270,7 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions {
make $qast;
}
else {
make QAST::Regex.new( QAST::Node.new(
make QAST::Regex.new( QAST::NodeList.new(
QAST::SVal.new( :value('!LITERAL') ),
$quote,
QAST::IVal.new( :value(%*RX<i> ?? 1 !! 0) ) ),
Expand Down Expand Up @@ -7309,7 +7309,7 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions {
}

method metachar:sym<rakvar>($/) {
make QAST::Regex.new( QAST::Node.new(
make QAST::Regex.new( QAST::NodeList.new(
QAST::SVal.new( :value('INTERPOLATE') ),
$<var>.ast,
QAST::IVal.new( :value(%*RX<i> ?? 1 !! 0) ),
Expand All @@ -7319,7 +7319,7 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions {

method assertion:sym<{ }>($/) {
make QAST::Regex.new(
QAST::Node.new(
QAST::NodeList.new(
QAST::SVal.new( :value('INTERPOLATE') ),
$<codeblock>.ast,
QAST::IVal.new( :value(%*RX<i> ?? 1 !! 0) ),
Expand All @@ -7335,7 +7335,7 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions {
}

method assertion:sym<var>($/) {
make QAST::Regex.new( QAST::Node.new(
make QAST::Regex.new( QAST::NodeList.new(
QAST::SVal.new( :value('INTERPOLATE') ),
$<var>.ast,
QAST::IVal.new( :value(%*RX<i> ?? 1 !! 0) ),
Expand Down Expand Up @@ -7374,20 +7374,20 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions {
if +@parts {
my $gref := QAST::WVal.new( :value($*W.find_symbol(@parts)) );
$qast := QAST::Regex.new(:rxtype<subrule>, :subtype<capture>,
:node($/), QAST::Node.new(
:node($/), QAST::NodeList.new(
QAST::SVal.new( :value('OTHERGRAMMAR') ),
$gref, QAST::SVal.new( :value($name) )),
:name(~$<longname>) );
} elsif $*W.regex_in_scope('&' ~ $name) {
$qast := QAST::Regex.new(:rxtype<subrule>, :subtype<capture>,
:node($/), QAST::Node.new(
:node($/), QAST::NodeList.new(
QAST::SVal.new( :value('INDRULE') ),
QAST::Var.new( :name('&' ~ $name), :scope('lexical') ) ),
:name($name) );
}
else {
$qast := QAST::Regex.new(:rxtype<subrule>, :subtype<capture>,
:node($/), QAST::Node.new(QAST::SVal.new( :value($name) )),
:node($/), QAST::NodeList.new(QAST::SVal.new( :value($name) )),
:name($name) );
}
if $<arglist> {
Expand All @@ -7413,7 +7413,7 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions {
}
else {
make QAST::Regex.new( :rxtype<subrule>, :subtype<method>,
QAST::Node.new(QAST::SVal.new( :value('RECURSE') )), :node($/) );
QAST::NodeList.new(QAST::SVal.new( :value('RECURSE') )), :node($/) );
}
}

Expand Down Expand Up @@ -7463,7 +7463,7 @@ class Perl6::P5RegexActions is QRegex::P5Regex::Actions does STDActions {

method p5metachar:sym<(??{ })>($/) {
make QAST::Regex.new(
QAST::Node.new(
QAST::NodeList.new(
QAST::SVal.new( :value('INTERPOLATE') ),
$<codeblock>.ast,
QAST::IVal.new( :value(%*RX<i> ?? 1 !! 0) ),
Expand All @@ -7473,7 +7473,7 @@ class Perl6::P5RegexActions is QRegex::P5Regex::Actions does STDActions {
}

method p5metachar:sym<var>($/) {
make QAST::Regex.new( QAST::Node.new(
make QAST::Regex.new( QAST::NodeList.new(
QAST::SVal.new( :value('INTERPOLATE') ),
$<var>.ast,
QAST::IVal.new( :value(%*RX<i> ?? 1 !! 0) ),
Expand Down

0 comments on commit 1f4cae6

Please sign in to comment.