diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index ae8a96eb777..c1e1a95ba21 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -960,7 +960,7 @@ class Perl6::Actions is HLL::Actions does STDActions { method statement_control:sym($/) { my $past := QAST::Stmts.new(:node($/)); my $name_past := $ - ?? QAST::SVal.new(:value($.Str)) + ?? $*W.disect_longname($).name_past() !! $[0].ast; $past.push(QAST::Op.new( diff --git a/src/Perl6/World.pm b/src/Perl6/World.pm index ef7b9e288e7..93799080ad6 100644 --- a/src/Perl6/World.pm +++ b/src/Perl6/World.pm @@ -1544,6 +1544,24 @@ class Perl6::World is HLL::World { nqp::join('::', @parts) ~ ($with_adverbs ?? nqp::join('', @!colonpairs) !! ''); } + + # returns a QAST tree that represents the name + # currently needed for 'require ::($modulename) ' + # ignore adverbs for now + method name_past() { + if self.contains_indirect_lookup() { + if @!components == 1 { + return @!components[0]; + } + else { + nqp::die("Not yet implemented :("); + } + } + else { + my $value := nqp::join('::', @!components); + QAST::SVal.new(:$value); + } + } # Gets the individual components, which may be PAST nodes for # unknown pieces.