summaryrefslogtreecommitdiffstats
path: root/lib/Text/Handlebars/Compiler.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-15 00:42:07 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-15 02:09:09 -0500
commit89749c72af405d0ec10c6003d2c86872042c1f77 (patch)
treec0aaff0c966d3caf68eb326070740aa429b2ccdc /lib/Text/Handlebars/Compiler.pm
parent0914ff4df45f9e3d64abc331038b593a4a990b01 (diff)
downloadtext-handlebars-89749c72af405d0ec10c6003d2c86872042c1f77.tar.gz
text-handlebars-89749c72af405d0ec10c6003d2c86872042c1f77.zip
turned render_string into an opcode
Diffstat (limited to 'lib/Text/Handlebars/Compiler.pm')
-rw-r--r--lib/Text/Handlebars/Compiler.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Text/Handlebars/Compiler.pm b/lib/Text/Handlebars/Compiler.pm
index cf4ad39..251050b 100644
--- a/lib/Text/Handlebars/Compiler.pm
+++ b/lib/Text/Handlebars/Compiler.pm
@@ -207,7 +207,7 @@ sub is_unary {
my ($id) = @_;
my %unary = (
- map { $_ => 1 } qw(builtin_is_array_ref is_code_ref)
+ map { $_ => 1 } qw(builtin_is_array_ref is_code_ref render_string)
);
return $unary{$id};
@@ -250,12 +250,10 @@ sub _generate_run_code {
);
}
- # XXX turn this into an opcode
- my $render_string = $self->call(
- $node,
- '(render_string)',
- $to_render,
- $self->vars,
+ my $render_string = $self->parser->symbol('(render_string)')->clone(
+ id => 'render_string',
+ arity => 'unary',
+ first => $to_render,
);
return $self->compile_ast($render_string);