summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-08 15:28:32 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-08 15:28:32 -0500
commit6ac98d38a537c1dd92bd442800d14565bbf511aa (patch)
tree574ad0d4c4134171e1cdde27d4ca98f996a9c4d8
parentfc3a232b4651894456961a143475b34fe948e08f (diff)
downloadtext-handlebars-6ac98d38a537c1dd92bd442800d14565bbf511aa.tar.gz
text-handlebars-6ac98d38a537c1dd92bd442800d14565bbf511aa.zip
make this a bit more explicit
-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;