New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make require use CompUnit interface for importing #694
Conversation
|
tests: Raku/roast#100 |
|
👍 |
b87cec3
to
d924ae2
Compare
| @@ -1821,32 +1807,20 @@ class Perl6::Actions is HLL::Actions does STDActions { | |||
| ), | |||
| ); | |||
| } | |||
| $past.push(QAST::Op.new( | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging of GLOBALish moved to REQUIRE_IMPORT
|
I've cleared up this commit a bit and added a bunch of github comments to make things a bit clearer. |
|
👍 |
|
Seems this patch causes some breakage for me, e.g.: $ perl6 t/spec/S01-perl-5-integration/exception_handling.t Looks like you planned 3 tests, but ran 0Complete list: Is this a known issue with this patch? |
|
Oh I never tested p5 integration. I'll take a look thanks.
|
|
So the problem with this patch is that it uses BEGIN { UNIT; Nil }And CU::R::Perl5 uses |
The following now works:
1. require 'lib/Module.pm' <sym>;
2. require Module <sym>; # where <sym> isn't inside a module
Also, no more erroneous "useless use of.." sink context when doing
`require ::('Test') <&ok>`.
|
changed Tests for require at compile time added in: |
Uses the
CompUnitobject to do the importing of symbols and merging of globalish in&REQUIRE_IMPORTinstead of some haphazardCALLER::OUR::thing. This makes things a bit less brittle and fixes a few bugs.The following now works:
my $name = "/lib/Module.pm"; require $name <sym>;require Module <sym>; # where <sym> isn't inside a module/packagebonus: no more "useless use of blah in sink context"
Fixes:
note the first chunk removed in actions is just because it's dead code that can't be reached.