From 6ac98d38a537c1dd92bd442800d14565bbf511aa Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 8 Oct 2012 15:28:32 -0500 Subject: make this a bit more explicit --- lib/Text/Handlebars/Compiler.pm | 3 ++- lib/Text/Handlebars/Symbol.pm | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3