NAME

Text::Nunjucks::Parser - 1:1 port of Nunjucks src/parser.js -- the recursive-descent parser

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/parser.js. Turns a template string into an AST of Text::Nunjucks::Nodes nodes.

my $ast = Text::Nunjucks::Parser->parse( '{{ a }}', \@extensions, \%opts );

parse mirrors upstream's module.exports.parse: it lexes the source with Text::Nunjucks::Lexer, applies any extensions, and returns the Root node from parse_as_root. The parser class itself is the Moo class Text::Nunjucks::Parser::Parser (reachable as Text::Nunjucks::Parser->parser_class, mirroring upstream's exported Parser).

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.