diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-10-15 00:42:07 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-10-15 02:09:09 -0500 |
commit | 89749c72af405d0ec10c6003d2c86872042c1f77 (patch) | |
tree | c0aaff0c966d3caf68eb326070740aa429b2ccdc /lib/Text/Handlebars/Compiler.pm | |
parent | 0914ff4df45f9e3d64abc331038b593a4a990b01 (diff) | |
download | text-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.pm | 12 |
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); |