From 1f4cae6b15bc408a03fef74dc2a41b64e5004fa3 Mon Sep 17 00:00:00 2001 From: jnthn Date: Fri, 8 Aug 2014 00:40:42 +0200 Subject: [PATCH] A few changes needed by qast_restructure in NQP. Only one known regressions remains, which is related to compile-time inlining of multis. --- src/Perl6/Actions.nqp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Perl6/Actions.nqp b/src/Perl6/Actions.nqp index 62dc34a6b71..e621c056f9b 100644 --- a/src/Perl6/Actions.nqp +++ b/src/Perl6/Actions.nqp @@ -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 @@ -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 ?? 1 !! 0) ) ), @@ -7309,7 +7309,7 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions { } method metachar:sym($/) { - make QAST::Regex.new( QAST::Node.new( + make QAST::Regex.new( QAST::NodeList.new( QAST::SVal.new( :value('INTERPOLATE') ), $.ast, QAST::IVal.new( :value(%*RX ?? 1 !! 0) ), @@ -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') ), $.ast, QAST::IVal.new( :value(%*RX ?? 1 !! 0) ), @@ -7335,7 +7335,7 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions { } method assertion:sym($/) { - make QAST::Regex.new( QAST::Node.new( + make QAST::Regex.new( QAST::NodeList.new( QAST::SVal.new( :value('INTERPOLATE') ), $.ast, QAST::IVal.new( :value(%*RX ?? 1 !! 0) ), @@ -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, :subtype, - :node($/), QAST::Node.new( + :node($/), QAST::NodeList.new( QAST::SVal.new( :value('OTHERGRAMMAR') ), $gref, QAST::SVal.new( :value($name) )), :name(~$) ); } elsif $*W.regex_in_scope('&' ~ $name) { $qast := QAST::Regex.new(:rxtype, :subtype, - :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, :subtype, - :node($/), QAST::Node.new(QAST::SVal.new( :value($name) )), + :node($/), QAST::NodeList.new(QAST::SVal.new( :value($name) )), :name($name) ); } if $ { @@ -7413,7 +7413,7 @@ class Perl6::RegexActions is QRegex::P6Regex::Actions does STDActions { } else { make QAST::Regex.new( :rxtype, :subtype, - QAST::Node.new(QAST::SVal.new( :value('RECURSE') )), :node($/) ); + QAST::NodeList.new(QAST::SVal.new( :value('RECURSE') )), :node($/) ); } } @@ -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') ), $.ast, QAST::IVal.new( :value(%*RX ?? 1 !! 0) ), @@ -7473,7 +7473,7 @@ class Perl6::P5RegexActions is QRegex::P5Regex::Actions does STDActions { } method p5metachar:sym($/) { - make QAST::Regex.new( QAST::Node.new( + make QAST::Regex.new( QAST::NodeList.new( QAST::SVal.new( :value('INTERPOLATE') ), $.ast, QAST::IVal.new( :value(%*RX ?? 1 !! 0) ),