diff options
Diffstat (limited to 'lib/Text/Handlebars')
-rw-r--r-- | lib/Text/Handlebars/Compiler.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Text/Handlebars/Compiler.pm b/lib/Text/Handlebars/Compiler.pm index 5f112fc..2fc7422 100644 --- a/lib/Text/Handlebars/Compiler.pm +++ b/lib/Text/Handlebars/Compiler.pm @@ -3,6 +3,8 @@ use Any::Moose; extends 'Text::Xslate::Compiler'; +use Try::Tiny; + has '+syntax' => ( default => 'Handlebars', ); @@ -19,6 +21,16 @@ sub _generate_block { return @compiled; } +sub _generate_include { + my $self = shift; + my ($node) = @_; + + my $file = $node->first; + $file->id($file->id . $self->engine->{suffix}) + unless try { $self->engine->find_file($file->id); 1 }; + return $self->SUPER::_generate_include($node); +} + if (0) { our $_recursing; around compile_ast => sub { |