diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-10-08 13:38:36 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-10-08 13:38:36 -0500 |
commit | 52ea1ea3f9d1bd29dcb7b056536a8b3f58268dee (patch) | |
tree | 97ce9384137924d90170047c615438023fa09f18 /lib/Text/Handlebars/Compiler.pm | |
parent | 6d3b76546c92f15aadc2a9c4b7568411e49ccfbe (diff) | |
download | text-handlebars-52ea1ea3f9d1bd29dcb7b056536a8b3f58268dee.tar.gz text-handlebars-52ea1ea3f9d1bd29dcb7b056536a8b3f58268dee.zip |
implement hash args for normal helpers
Diffstat (limited to 'lib/Text/Handlebars/Compiler.pm')
-rw-r--r-- | lib/Text/Handlebars/Compiler.pm | 11 |
1 files changed, 9 insertions, 2 deletions
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); |