summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Text/Handlebars/Compiler.pm3
-rw-r--r--lib/Text/Handlebars/Symbol.pm5
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Text/Handlebars/Compiler.pm b/lib/Text/Handlebars/Compiler.pm
index a1cfddb..4df30aa 100644
--- a/lib/Text/Handlebars/Compiler.pm
+++ b/lib/Text/Handlebars/Compiler.pm
@@ -61,7 +61,7 @@ sub _generate_call {
unshift @args, $self->vars;
- if ($node->first->arity eq 'call' && $node->first->first->id eq '(make_block_helper)') {
+ if ($node->is_block_helper) {
push @{ $node->first->second }, $hash;
$node->second(\@args);
}
@@ -120,6 +120,7 @@ sub _generate_block {
? $block{else}{raw_text}->clone
: $self->parser->literal('')),
),
+ is_block_helper => 1,
),
);
}
diff --git a/lib/Text/Handlebars/Symbol.pm b/lib/Text/Handlebars/Symbol.pm
index 6db7ac9..36fd3ba 100644
--- a/lib/Text/Handlebars/Symbol.pm
+++ b/lib/Text/Handlebars/Symbol.pm
@@ -8,6 +8,11 @@ has is_helper => (
isa => 'Bool',
);
+has is_block_helper => (
+ is => 'rw',
+ isa => 'Bool',
+);
+
__PACKAGE__->meta->make_immutable;
no Any::Moose;