summaryrefslogtreecommitdiffstats
path: root/lib/Text/Xslate
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-08 14:15:23 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-08 14:15:23 -0500
commit703ac3ef783a86eac77af2c402c6600c33e6a71c (patch)
tree7d7552cbc02a792d742b4760b784b41a2569ce64 /lib/Text/Xslate
parent52ea1ea3f9d1bd29dcb7b056536a8b3f58268dee (diff)
downloadtext-handlebars-703ac3ef783a86eac77af2c402c6600c33e6a71c.tar.gz
text-handlebars-703ac3ef783a86eac77af2c402c6600c33e6a71c.zip
move more bits into the compiler
Diffstat (limited to 'lib/Text/Xslate')
-rw-r--r--lib/Text/Xslate/Syntax/Handlebars.pm27
1 files changed, 11 insertions, 16 deletions
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) = @_;