'GROUP \s+ BY',
'HAVING',
'ORDER \s+ BY',
+ 'I?LIKE',
);
my $unrollable_ops_re = join ' | ', @unrollable_ops;
$unrollable_ops_re = qr/$unrollable_ops_re/xi;
for my $child (@{$ast->[1]}) {
# the current node in this loop is *always* a PAREN
- if (not ref $child or not $child->[0] eq 'PAREN') {
+ if (! ref $child or ! @$child or $child->[0] ne 'PAREN') {
push @children, $child;
next;
}
}
# only *ONE* LITERAL or placeholder element
+ # as an AND/OR/NOT argument
elsif (
@{$child->[1]} == 1 && (
$child->[1][0][0] eq 'LITERAL'
or
$child->[1][0][0] eq 'PLACEHOLDER'
+ ) && (
+ $ast->[0] eq 'AND' or $ast->[0] eq 'OR' or $ast->[0] eq 'NOT'
)
) {
push @children, $child->[1][0];