From: Matt S Trout Date: Tue, 5 Mar 2019 02:28:23 +0000 (+0000) Subject: rename node_types to render X-Git-Tag: v2.000000~3^2~410 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2996c0932415aaa504f59ff702c70f79718365ee;p=dbsrgits%2FSQL-Abstract.git rename node_types to render --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 7e5f1f3..d0d9e94 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -184,9 +184,9 @@ sub new { ^ \s* go \s /xmi; - $opt{node_types} = +{ - map +("-$_" => '_render_'.$_), - qw(op func bind ident literal list) + $opt{render} = { + (map +("-$_", "_render_$_"), qw(op func bind ident literal list)), + %{$opt{render}||{}} }; $opt{expand_unary} = {}; @@ -512,7 +512,7 @@ sub render_aqt { my ($self, $aqt) = @_; my ($k, $v, @rest) = %$aqt; die "No" if @rest; - if (my $meth = $self->{node_types}{$k}) { + if (my $meth = $self->{render}{$k}) { return $self->$meth($v); } die "notreached: $k"; @@ -659,7 +659,7 @@ sub _expand_expr_hashpair { if (my $custom = $self->{expand_unary}{$k}) { return $self->$custom($v); } - if ($self->{node_types}{$k}) { + if ($self->{render}{$k}) { return { $k => $v }; } if (