NAME

Text::Nunjucks::Transformer - 1:1 port of Nunjucks src/transformer.js -- the async CPS rewrite

VERSION

version 0.001

DESCRIPTION

Engine-internal: this module is a stage of the template pipeline, used by Text::Nunjucks::Environment, and not an interface for applications.

A 1:1 port of Nunjucks src/transformer.js. Called as a class method:

my $ast2 = Text::Nunjucks::Transformer->transform( $ast, \@async_filters );

Given a parse tree and the list of filter names the environment has registered as asynchronous, it rewrites the tree into the form the compiler expects for callback (CPS) emission (ADR 0003): async filters and CallExtensionAsync nodes are lifted out into FilterAsync temporaries, {{ super() }} calls become explicit Super nodes, and any If/For that transitively contains async work is retyped to IfAsync / AsyncEach.

SUPPORT

Issues

Please report bugs and feature requests at https://github.com/Getty/p5-text-nunjucks/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.