Skip to content

Instantly share code, notes, and snippets.

@MasterDuke17
Created May 5, 2017 19:14
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 MasterDuke17/c0718c4c09eb049f3c7ed074f03fff25 to your computer and use it in GitHub Desktop.
Save MasterDuke17/c0718c4c09eb049f3c7ed074f03fff25 to your computer and use it in GitHub Desktop.
diff --git a/src/Perl6/Actions.nqp b/src/Perl6/Actions.nqp
index a93fb954f..5ce65cd33 100644
--- a/src/Perl6/Actions.nqp
+++ b/src/Perl6/Actions.nqp
@@ -6558,6 +6558,11 @@ class Perl6::Actions is HLL::Actions does STDActions {
# as its last argument.
$_.push(QAST::Op.new( :op('call'), $result ));
}
+ elsif $_.isa(QAST::Op) && $_.op eq 'ifnull' && $_[0].isa(QAST::Var) && nqp::substr($_[0].name, 0, 1) eq '&' {
+ # It's a `==> &sub`. Rework into a call and stick a call to
+ # the current supplier in as its last argument.
+ $_ := QAST::Op.new( :op('call'), :name($_[0].name), QAST::Op.new( :op('call'), $result ));
+ }
elsif $_ ~~ QAST::Var {
# It's a variable. We need code that gets the results, pushes
# them onto the variable and then returns them (since this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment