Skip to content

Instantly share code, notes, and snippets.

@FROGGS
Created November 19, 2014 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FROGGS/46ffb87fb14ae04c7083 to your computer and use it in GitHub Desktop.
Save FROGGS/46ffb87fb14ae04c7083 to your computer and use it in GitHub Desktop.
$ perl6-m --ll-exception -e 'sub a is export { "foo" }; say &EXPORT::ALL::a()'
foo
$ perl6-m --ll-exception -e 'sub a is export { "foo" }; say &EXPORT::ALL::a'
sub a () { #`(Sub|83431696) ... }
$ perl6-m --ll-exception -e 'sub a is export { "foo" }; say EXPORT::ALL::a'
(Any)
diff --git a/src/Perl6/World.nqp b/src/Perl6/World.nqp
index 327fc4e..b5e49ea 100644
--- a/src/Perl6/World.nqp
+++ b/src/Perl6/World.nqp
@@ -2237,7 +2237,7 @@ class Perl6::World is HLL::World {
# Checks if a name component is a pseudo-package.
method is_pseudo_package($comp) {
!nqp::istype($comp, QAST::Node) && (
- $comp eq 'CORE' || $comp eq 'SETTING' || $comp eq 'UNIT' ||
+ $comp eq 'CORE' || $comp eq 'SETTING' || $comp eq 'UNIT' || $comp eq 'EXPORT' ||
$comp eq 'OUTER' || $comp eq 'MY' || $comp eq 'OUR' ||
$comp eq 'PROCESS' || $comp eq 'GLOBAL' || $comp eq 'CALLER' ||
$comp eq 'DYNAMIC' || $comp eq 'COMPILING' || $comp eq 'PARENT')
diff --git a/src/core/PseudoStash.pm b/src/core/PseudoStash.pm
index a456dcf..ce4bbed 100644
--- a/src/core/PseudoStash.pm
+++ b/src/core/PseudoStash.pm
@@ -83,6 +83,11 @@ my class PseudoStash is EnumMap {
Metamodel::ModuleHOW.new_type(:name('UNIT')),
$stash);
},
+ 'EXPORT' => sub ($cur) {
+ nqp::getlexrel(
+ nqp::getattr(nqp::decont($cur), PseudoStash, '$!ctx'),
+ 'EXPORT')
+ },
'SETTING' => sub ($cur) {
# Same as UNIT, but go a little further out (two steps, for
# internals reasons).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment