Created
June 9, 2025 09:51
-
-
Save MasterDuke17/848ea46e48cea41d0e610988613a9f44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git src/Raku/ast/package.rakumod src/Raku/ast/package.rakumod | |
index ab16d21d4..2baf0a6a7 100644 | |
--- src/Raku/ast/package.rakumod | |
+++ src/Raku/ast/package.rakumod | |
@@ -267,7 +267,7 @@ method install-extra-declarations(RakuAST::Resolver $resolver) { | |
# Need to install the package somewhere | |
method install-in-scope(RakuAST::Resolver $resolver, str $scope, RakuAST::Name $name, RakuAST::Name $full-name) { | |
self.IMPL-INSTALL-PACKAGE( | |
- $resolver, $scope, $name, $resolver.current-package, :meta-object(Mu) | |
+ $resolver, $scope, $full-name, $resolver.current-package, :meta-object(Mu) | |
) if $scope eq 'my' || $scope eq 'our'; | |
} | |
@@ -588,7 +588,7 @@ method install-in-scope(RakuAST::Resolver $resolver, str $scope, RakuAST::Na | |
:name($group-name), :repr(self.repr) | |
); | |
self.IMPL-INSTALL-PACKAGE( | |
- $resolver, $scope, $name, $resolver.current-package, | |
+ $resolver, $scope, $full-name, $resolver.current-package, | |
:meta-object($group), | |
); | |
} | |
diff --git src/Raku/ast/parsetime.rakumod src/Raku/ast/parsetime.rakumod | |
index 4ee132083..41527093b 100644 | |
--- src/Raku/ast/parsetime.rakumod | |
+++ src/Raku/ast/parsetime.rakumod | |
@@ -64,6 +64,8 @@ method IMPL-BEGIN-TIME-CALL(RakuAST::Node $callee, RakuAST::ArgList $args, | |
return $resolved(|@pos, |%named); | |
} | |
else { | |
+ nqp::note("callee.is-resolved = " ~ $callee.is-resolved ~ " nqp::istype(callee.resolution, RakuAST::CompileTimeValue) = " ~ nqp::istype($callee.resolution, RakuAST::CompileTimeValue) ~ " args.IMPL-CAN-INTERPRET = " ~ $args.IMPL-CAN-INTERPRET); | |
+ nqp::note("callee: " ~ $callee.dump ~ "\ncallee origin: " ~ $callee.origin.new.Str ~ "\nargs: " ~ $args.dump ~ "\nargs origin: " ~ $args.origin.new.Str); | |
nqp::die('BEGIN time calls only supported for simple constructs so far') | |
} | |
} | |
diff --git src/Raku/ast/resolver.rakumod src/Raku/ast/resolver.rakumod | |
index 75c6090c2..60264b448 100644 | |
--- src/Raku/ast/resolver.rakumod | |
+++ src/Raku/ast/resolver.rakumod | |
@@ -217,16 +217,26 @@ method IMPL-RESOLVE-NAME-IN-PACKAGES($Rname, :$sigil, Bool :$partial) { | |
# it being passed as an argument then??? XXX | |
# $name := $sigil ~ $name if $sigil; | |
- for $!packages { | |
- my $stash := self.IMPL-STASH-HASH($_.compile-time-value); | |
- return $partial | |
- ?? ($stash{$name}, List.new, 'global') | |
- !! self.external-constant($stash, $name) | |
- if nqp::existskey($stash,$name); | |
- } | |
+ my @parts := nqp::clone($Rname.IMPL-UNWRAP-LIST($Rname.parts)); | |
+ for @parts { | |
+ my $pname := nqp::istype($_,RakuAST::Name::Part::Simple) | |
+ ?? $_.name | |
+ !! ''; | |
+ for $!packages { | |
+ #nqp::note($_.DUMP); | |
+ if !$_.has-compile-time-value { | |
+ # XXX should throw | |
+ last; | |
+ } | |
+ my $stash := self.IMPL-STASH-HASH($_.compile-time-value); | |
+ return $partial | |
+ ?? ($stash{$pname}, List.new, 'global') | |
+ !! self.external-constant($stash, $pname) | |
+ if nqp::existskey($stash,$pname); | |
+ } | |
+ } | |
my $symbol := $!global; | |
- my @parts := nqp::clone($Rname.IMPL-UNWRAP-LIST($Rname.parts)); | |
while @parts { | |
my $part := @parts.shift; | |
$name := nqp::istype($part,RakuAST::Name::Part::Simple) | |
diff --git src/Raku/ast/scoping.rakumod src/Raku/ast/scoping.rakumod | |
index 7e1fc773d..6b3ff5392 100644 | |
--- src/Raku/ast/scoping.rakumod | |
+++ src/Raku/ast/scoping.rakumod | |
@@ -619,6 +619,14 @@ method generate-lookup() { | |
$lookup.set-resolution(self); | |
$lookup | |
} | |
+ | |
+ method has-compile-time-value() { | |
+ $!maybe-compile-time-value ?? True !! False | |
+ } | |
+ | |
+ method compile-time-value() { | |
+ $!maybe-compile-time-value | |
+ } | |
} | |
class RakuAST::Declaration::Mergeable { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment