From: Matt S Trout Date: Mon, 1 Apr 2019 05:02:14 +0000 (+0000) Subject: remove leading - from expand and render X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7256c84486eccdf349434600eff804ed9479a38e;p=scpubgit%2FQ-Branch.git remove leading - from expand and render --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 2d9d883..3ecce64 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -223,7 +223,7 @@ sub new { }; $opt{render} = { - (map +("-$_", "_render_$_"), qw(op func bind ident literal row)), + (map +($_, "_render_$_"), qw(op func bind ident literal row)), %{$opt{render}||{}} }; @@ -562,6 +562,7 @@ sub render_aqt { my ($self, $aqt) = @_; my ($k, $v, @rest) = %$aqt; die "No" if @rest; + die "Also no" unless $k =~ s/^-//; if (my $meth = $self->{render}{$k}) { return $self->$meth($v); } @@ -746,7 +747,7 @@ sub _expand_hashpair_op { # an explicit node type is currently assumed to be expanded (this is almost # certainly wrong and there should be expansion anyway) - if ($self->{render}{$k}) { + if ($self->{render}{$op}) { return { $k => $v }; }