summaryrefslogtreecommitdiffstats
path: root/lib/Text/Handlebars/Compiler.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Text/Handlebars/Compiler.pm')
-rw-r--r--lib/Text/Handlebars/Compiler.pm11
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);