From 65863e46cd8c4f374f1de8b669c69849ee5e22e7 Mon Sep 17 00:00:00 2001 From: djcb Date: Tue, 31 Oct 2017 07:18:14 +0200 Subject: [PATCH] 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). --- lib/parser/parser.cc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/parser/parser.cc b/lib/parser/parser.cc index f416c19f..cdb6f55f 100644 --- a/lib/parser/parser.cc +++ b/lib/parser/parser.cc @@ -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(); }