diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-01-02 18:32:10 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-01-02 18:32:10 -0600 |
commit | b7e75b21e640ccd8aa7ee1e9827b8b4121e1a2d1 (patch) | |
tree | c859ef6a565cbb9ed47026cb0fe82ec7fc3b87e0 /lib/Text/Xslate/Syntax/Handlebars.pm | |
parent | e84a7c1f51e84f26b0edd611c122c6ed92939261 (diff) | |
download | text-handlebars-b7e75b21e640ccd8aa7ee1e9827b8b4121e1a2d1.tar.gz text-handlebars-b7e75b21e640ccd8aa7ee1e9827b8b4121e1a2d1.zip |
implement passing new context to partials
Diffstat (limited to 'lib/Text/Xslate/Syntax/Handlebars.pm')
-rw-r--r-- | lib/Text/Xslate/Syntax/Handlebars.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Text/Xslate/Syntax/Handlebars.pm b/lib/Text/Xslate/Syntax/Handlebars.pm index b8854ea..164c03f 100644 --- a/lib/Text/Xslate/Syntax/Handlebars.pm +++ b/lib/Text/Xslate/Syntax/Handlebars.pm @@ -435,10 +435,16 @@ sub std_partial { my $partial = $self->token->clone(arity => 'literal'); $self->advance; + my $args; + if ($self->token->id ne ';') { + $args = $self->expression(0); + } + $self->advance(';'); return $symbol->clone( - arity => 'partial', - first => ($partial->id =~ /\./ ? $partial : [ $partial ]), + arity => 'partial', + first => ($partial->id =~ /\./ ? $partial : [ $partial ]), + second => $args, ); } |