diff options
Diffstat (limited to 'lib/Text/Handlebars')
-rw-r--r-- | lib/Text/Handlebars/Compiler.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Text/Handlebars/Compiler.pm b/lib/Text/Handlebars/Compiler.pm index d713fc1..48844d1 100644 --- a/lib/Text/Handlebars/Compiler.pm +++ b/lib/Text/Handlebars/Compiler.pm @@ -57,7 +57,7 @@ sub _generate_call { } } - my $hash = $self->call($node, '(make_hash)', @hash); + my $hash = $self->make_hash(@hash); unshift @args, $self->vars; @@ -287,6 +287,16 @@ sub make_array { ); } +sub make_hash { + my $self = shift; + my (@contents) = @_; + + return $self->parser->symbol('{')->clone( + arity => 'composer', + first => \@contents, + ); +} + __PACKAGE__->meta->make_immutable; no Any::Moose; |