diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-10-05 20:21:58 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-10-05 20:21:58 -0500 |
commit | 096cd67f8009aba4ad755aacb9b868a8170c2cce (patch) | |
tree | 374fb001f1e58b13a16e67e807a567ca517aa822 /lib/Text/Xslate/Syntax | |
parent | 1afa9c6244203f657942a12092a43d06f73d3b3a (diff) | |
download | text-handlebars-096cd67f8009aba4ad755aacb9b868a8170c2cce.tar.gz text-handlebars-096cd67f8009aba4ad755aacb9b868a8170c2cce.zip |
move this earlier
Diffstat (limited to 'lib/Text/Xslate/Syntax')
-rw-r--r-- | lib/Text/Xslate/Syntax/Handlebars.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Text/Xslate/Syntax/Handlebars.pm b/lib/Text/Xslate/Syntax/Handlebars.pm index c963a87..ac217d9 100644 --- a/lib/Text/Xslate/Syntax/Handlebars.pm +++ b/lib/Text/Xslate/Syntax/Handlebars.pm @@ -384,6 +384,16 @@ sub std_block { $block{$context}{close_tag} = $self->token; $self->advance; + if ($inverted) { + ($block{if}, $block{else}) = ($block{else}, $block{if}); + if (!$block{if}) { + $block{if}{body} = $self->literal(''); + $block{if}{raw_text} = $self->literal(''); + $block{if}{open_tag} = $block{else}{open_tag}; + $block{if}{close_tag} = $block{else}{close_tag}; + } + } + my $closing_name = $self->expression(0); if ($closing_name->arity ne 'key' && $closing_name->arity ne 'key_field' && $closing_name->arity ne 'call') { @@ -411,16 +421,6 @@ sub std_block { ); } - if ($inverted) { - ($block{if}, $block{else}) = ($block{else}, $block{if}); - if (!$block{if}) { - $block{if}{body} = $self->literal(''); - $block{if}{raw_text} = $self->literal(''); - $block{if}{open_tag} = $block{else}{open_tag}; - $block{if}{close_tag} = $block{else}{close_tag}; - } - } - my $iterations = $self->make_ternary( $self->call('(is_falsy)', $name->clone), $self->call('(make_array)', $self->literal(1)), |