Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap subs in a NQPRoutine code object when NQPRoutine is in scope.
We need capturelex to get that to work properly. I's a port of p6capturelex that takes the code objects type as an argument rather than assuming it's a Rakudo Code. We also add a test that ensures subs are wrapped in codeobjects.
- Loading branch information
Showing
9 changed files
with
116 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
plan(5); | ||
ok(nqp::istype(&say,NQPRoutine),"checking builtins, &say is a NQPRoutine"); | ||
ok(nqp::istype(&ok,NQPRoutine),"checking builtins, &ok is a NQPRoutine"); | ||
sub foo() { | ||
} | ||
ok(nqp::istype(&foo,NQPRoutine),"named sub is NQPRoutine"); | ||
ok(nqp::istype(sub() {},NQPRoutine),"anoymous sub is NQPRoutine"); | ||
my $foo := sub bar() { | ||
}; | ||
ok(nqp::istype($foo,NQPRoutine),"binding a named sub to a value results in a NQPRoutine"); | ||
|
This file contains 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