Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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...
commit 9bb7de6dbf77b29298dae64ed5707e08061f065a 1 parent e7ab9ac
Carl Mäsak masak authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/Perl6/Actions.pm
3  src/Perl6/Actions.pm
View
@@ -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 := $ast_class.new();
- nqp::bindattr($quasi_ast, $ast_class, '$!past', $expr);
+ my $wrapped := QAST::Op.new( :op('call'), make_thunk_ref($expr, $expr.node) );
+ nqp::bindattr($quasi_ast, $ast_class, '$!past', $wrapped);
@argument_asts.push($quasi_ast);
}
Please sign in to comment.
Something went wrong with that request. Please try again.