$opt{expand_unary} = {};
$opt{expand} = {
- -not => '_expand_not',
- -bool => '_expand_bool',
- -and => '_expand_op_andor',
- -or => '_expand_op_andor',
- -nest => '_expand_nest',
- -bind => '_expand_bind',
- -in => '_expand_in',
- -not_in => '_expand_in',
- -row => '_expand_row',
- -between => '_expand_between',
- -not_between => '_expand_between',
- -op => '_expand_op',
- (map +($_ => '_expand_op_is'), ('-is', '-is_not')),
- -ident => '_expand_ident',
- -value => '_expand_value',
+ not => '_expand_not',
+ bool => '_expand_bool',
+ and => '_expand_op_andor',
+ or => '_expand_op_andor',
+ nest => '_expand_nest',
+ bind => '_expand_bind',
+ in => '_expand_in',
+ not_in => '_expand_in',
+ row => '_expand_row',
+ between => '_expand_between',
+ not_between => '_expand_between',
+ op => '_expand_op',
+ (map +($_ => '_expand_op_is'), ('is', 'is_not')),
+ ident => '_expand_ident',
+ value => '_expand_value',
};
$opt{expand_op} = {
belch 'Use of [and|or|nest]_N modifiers is deprecated and will be removed in SQLA v2.0. '
. "You probably wanted ...-and => [ $key => COND1, $key => COND2 ... ]";
}
- if (my $exp = $self->{expand}{$key}) {
- return $self->$exp($key, $value);
- }
return $self->_expand_hashpair($key, $value);
}
if (ref($expr) eq 'ARRAY') {
my $op = $self->_normalize_op($k);
+ if (my $exp = $self->{expand}{$op}) {
+ return $self->$exp($k, $v);
+ }
+
# Ops prefixed with -not_ get converted
if (my ($rest) = $op =~/^not_(.*)$/) {
return +{ -op => [ ',', @exp ] };
};
- local @{$self->{expand}}{qw(-asc -desc)} = (($expander) x 2);
+ local @{$self->{expand}}{qw(asc desc)} = (($expander) x 2);
return $self->$expander(undef, $arg);
}