public
Created

pack, unpack, pack, unpack

  • Download Gist
steps.md
Markdown
  1. We wrap the macro argument QAST in a Perl6::AST object, which we incarnate immediately, since this is an object we'll only see one, due to the way parsing only proceeds forwards. This means we store OUTER information in the Perl6::AST.

  2. Most of the time, such a Perl6::AST object ends up in the unquote of a quasi. It should then be stripped of its Perl6::AST-hood, and the original QAST gets spliced into the quasi's QAST. We wrap the spliced-in QAST in a QAST::Block so that we can set the QAST::Block's OUTER to the Perl6::AST's OUTER. Since this is a runtime trait, we have to do this in the form of a fixup.

  3. The whole quasi is packaged up as an incarnated Perl6::AST.

  4. The macro returns, hopefully with a Perl6::AST. This is then similarly stripped of its Perl6::AST-hood, wrapped in a QAST::Block, and re-OUTERed with information from the Perl6::AST.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.