From 52ea1ea3f9d1bd29dcb7b056536a8b3f58268dee Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 8 Oct 2012 13:38:36 -0500 Subject: implement hash args for normal helpers --- lib/Text/Handlebars/Compiler.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/Text/Handlebars/Compiler.pm') diff --git a/lib/Text/Handlebars/Compiler.pm b/lib/Text/Handlebars/Compiler.pm index a358d2e..54f760d 100644 --- a/lib/Text/Handlebars/Compiler.pm +++ b/lib/Text/Handlebars/Compiler.pm @@ -103,8 +103,15 @@ sub _generate_call { line => $node->line, ); - push @{ $node->first->second }, $parser->call($make_hash, @hash); - $node->second(\@args); + my $hash = $parser->call($make_hash, @hash); + + if ($node->first->arity eq 'call' && $node->first->first->id eq '(make_block_helper)') { + push @{ $node->first->second }, $hash; + $node->second(\@args); + } + else { + $node->second([ @args, $hash ]); + } } return $self->SUPER::_generate_call($node); -- cgit v1.2.3-54-g00ecf