Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

[Perl6::Actions] wrap macro-arg ASTs in thunks

This causes the macro arguments to correctly carry
their lexical environment with them, and so everything
inside of them is now correctly, hygienically resolved.
  • Loading branch information...
1 parent e7ab9ac commit 9bb7de6dbf77b29298dae64ed5707e08061f065a @masak masak committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/Perl6/
3  src/Perl6/
@@ -3487,7 +3487,8 @@ class Perl6::Actions is HLL::Actions does STDActions {
sub add_macro_arguments($expr, $ast_class, @argument_asts) {
sub wrap_and_add_expr($expr) {
my $quasi_ast := $;
- nqp::bindattr($quasi_ast, $ast_class, '$!past', $expr);
+ my $wrapped := :op('call'), make_thunk_ref($expr, $expr.node) );
+ nqp::bindattr($quasi_ast, $ast_class, '$!past', $wrapped);

0 comments on commit 9bb7de6

Please sign in to comment.
Something went wrong with that request. Please try again.