Working on #48 : Updating ExpressionParser.py
This commit is contained in:
@@ -185,7 +185,8 @@ class LogicalOperatorParser(BaseExprParser):
|
||||
def parse_not(self, context, parser_input, error_sink):
|
||||
token = parser_input.token
|
||||
start = parser_input.pos
|
||||
if token.type == TokenKind.IDENTIFIER and token.value == "not":
|
||||
if (token.type == TokenKind.IDENTIFIER and token.value == "not" and
|
||||
parser_input.the_token_after(True).value != "in"):
|
||||
parser_input.next_token()
|
||||
parsed = self.parse_not(context, parser_input, error_sink)
|
||||
node = parsed.node if isinstance(parsed, ParenthesisNode) else parsed
|
||||
@@ -201,7 +202,8 @@ class LogicalOperatorParser(BaseExprParser):
|
||||
def stop():
|
||||
return token.type == TokenKind.EOF or \
|
||||
paren_count == 0 and token.type == TokenKind.RPAR or \
|
||||
token.type == TokenKind.IDENTIFIER and token.value in ("and", "or", "not")
|
||||
token.type == TokenKind.IDENTIFIER and token.value in ("and", "or") or \
|
||||
token.value == "not" and parser_input.the_token_after(True).value != "in"
|
||||
|
||||
token = parser_input.token
|
||||
if token.type == TokenKind.EOF:
|
||||
|
||||
Reference in New Issue
Block a user