summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-14 13:23:55 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-14 14:38:14 -0500
commit1bd9194b87f14c81133a8d1a4d17ca02d787dc5c (patch)
tree84dce8754463002bcc001a9473709a3dc4335adf
parent5170de4d15d7ff92f3c2a1897caa91928a8855ed (diff)
downloadtext-handlebars-1bd9194b87f14c81133a8d1a4d17ca02d787dc5c.tar.gz
text-handlebars-1bd9194b87f14c81133a8d1a4d17ca02d787dc5c.zip
neither does make_hash
-rw-r--r--lib/Text/Handlebars.pm4
-rw-r--r--lib/Text/Handlebars/Compiler.pm12
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/Text/Handlebars.pm b/lib/Text/Handlebars.pm
index 4d0a137..0a02f77 100644
--- a/lib/Text/Handlebars.pm
+++ b/lib/Text/Handlebars.pm
@@ -133,10 +133,6 @@ sub default_functions {
return !$val;
}
},
- '(make_hash)' => sub {
- my (%hash) = @_;
- return \%hash;
- },
'(is_code)' => sub {
my ($val) = @_;
return ref($val) && ref($val) eq 'CODE';
diff --git a/lib/Text/Handlebars/Compiler.pm b/lib/Text/Handlebars/Compiler.pm
index d713fc1..48844d1 100644
--- a/lib/Text/Handlebars/Compiler.pm
+++ b/lib/Text/Handlebars/Compiler.pm
@@ -57,7 +57,7 @@ sub _generate_call {
}
}
- my $hash = $self->call($node, '(make_hash)', @hash);
+ my $hash = $self->make_hash(@hash);
unshift @args, $self->vars;
@@ -287,6 +287,16 @@ sub make_array {
);
}
+sub make_hash {
+ my $self = shift;
+ my (@contents) = @_;
+
+ return $self->parser->symbol('{')->clone(
+ arity => 'composer',
+ first => \@contents,
+ );
+}
+
__PACKAGE__->meta->make_immutable;
no Any::Moose;