This is specified in RFC 3501 but was accidentally omitted :x
I probably got it confused with TEXT, so add a comment about
TEXT being "everything" in the message.
my %IH2X = (
SUBJECT => 's:',
BODY => 'b:',
+ # TEXT => undef, # => everything
FROM => 'f:',
TO => 't:',
CC => 'c:',
| CC_string
| BCC_string
| SUBJECT_string
+ | BODY_string
| TEXT_string
| UID_set
| MSN_set
CC_string : "CC" string { $q->ih2x('CC', $item{string}) }
BCC_string : "BCC" string { $q->ih2x('BCC', $item{string}) }
SUBJECT_string : "SUBJECT" string { $q->ih2x('SUBJECT', $item{string}) }
+BODY_string : "BODY" string { $q->ih2x('BODY', $item{string}) }
TEXT_string : "TEXT" string { $q->ih2x(undef, $item{string}) }
op_subq_enter : '(' { $q->subq_enter }
sub_query : op_subq_enter search_key1(s) ')' { $q->subq_leave }
my $q;
my $parse = sub { PublicInbox::IMAPsearchqp::parse($imap, $_[0]) };
+$q = $parse->(qq{BODY oops});
+is($q->{xap}, 'b:"oops"', 'BODY key supported');
+
$q = $parse->(qq{OR HEADER TO Brian (OR FROM Ryan (OR TO Joe CC Scott))});
is($q->{sql}, undef, 'not using SQLite for complex query');
is($q->{xap}, '(t:"brian" OR (f:"ryan" OR (t:"joe" OR c:"scott")))',