From 703ac3ef783a86eac77af2c402c6600c33e6a71c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 8 Oct 2012 14:15:23 -0500 Subject: move more bits into the compiler --- lib/Text/Xslate/Syntax/Handlebars.pm | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'lib/Text/Xslate') diff --git a/lib/Text/Xslate/Syntax/Handlebars.pm b/lib/Text/Xslate/Syntax/Handlebars.pm index 0929f2c..dc4713b 100644 --- a/lib/Text/Xslate/Syntax/Handlebars.pm +++ b/lib/Text/Xslate/Syntax/Handlebars.pm @@ -308,11 +308,6 @@ sub nud_name { my $call = $self->call($name); - if ($name->is_helper) { - $call->is_helper(1); - push @{ $call->second }, $self->vars; - } - if ($self->token->is_defined) { push @{ $call->second }, $self->expression(0); } @@ -504,17 +499,9 @@ sub std_partial { my $partial = $self->token->clone(arity => 'literal'); $self->advance; - return $self->make_ternary( - $self->call('(find_file)', $partial->clone), - $symbol->clone( - arity => 'include', - id => 'include', - first => $partial, - ), - $symbol->clone( - arity => 'literal', - id => '', - ), + return $symbol->clone( + arity => 'partial', + first => $partial, ); } @@ -617,6 +604,14 @@ sub expression { return $left; } +sub call { + my $self = shift; + + my $call = $self->SUPER::call(@_); + $call->is_helper($call->first->is_helper); + return $call; +} + sub make_field_lookup { my $self = shift; my ($var, $field, $dot) = @_; -- cgit v1.2.3-54-g00ecf