parser: fix and-not precedence
For now, don't treat "and not" specially; this gets us back into a somewhat working state. At some point, we probably _do_ want to special-case and_not though (since Xapian supports it).
This commit is contained in:
@ -237,23 +237,12 @@ factor_2 (Mux::Tokens& tokens, Node::Type& op, ProcPtr proc,
|
||||
switch (token.type) {
|
||||
case Token::Type::And: {
|
||||
tokens.pop_front();
|
||||
const auto token2 = look_ahead(tokens);
|
||||
if (token2.type == Token::Type::Not) { // AND NOT is a unit
|
||||
tokens.pop_front();
|
||||
op = Node::Type::OpAndNot;
|
||||
} else
|
||||
op = Node::Type::OpAnd;
|
||||
op = Node::Type::OpAnd;
|
||||
} break;
|
||||
case Token::Type::Open:
|
||||
case Token::Type::Data:
|
||||
op = Node::Type::OpAnd; // implicit AND
|
||||
break;
|
||||
case Token::Type::Not:
|
||||
tokens.pop_front();
|
||||
op = Node::Type::OpAndNot; // implicit AND NOT
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return empty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user