NAME

Text::MustacheTemplate::Generator - Template generator for Mustache templates

SYNOPSIS

use Text::MustacheTemplate::Lexer;
use Text::MustacheTemplate::Generator;

my @tokens = Text::MustacheTemplate::Lexer->tokenize('Hello {{name}}!');
my $regenerated_template = Text::MustacheTemplate::Generator->generate_from_tokens(@tokens);

# Result: 'Hello {{name}}!'

DESCRIPTION

Text::MustacheTemplate::Generator can regenerate a Mustache template from tokens. This is primarily used for lambda functions that need access to the raw template string.

This is a low-level interface for Text::MustacheTemplate. The APIs may change without notice.

METHODS

generate_from_tokens($delimiter_token, @tokens)

Regenerates a Mustache template string from lexer tokens.

Parameters: =over 8 =item $delimiter_token - The delimiter token containing open/close delimiters =item @tokens - Array of tokens from Text::MustacheTemplate::Lexer =back

Returns a string containing the regenerated template.

LICENSE

Copyright (C) karupanerura.

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

AUTHOR

karupanerura <karupa@cpan.org>