Working on #48 : Refactored FunctionParser.py
This commit is contained in:
@@ -148,16 +148,12 @@ class LogicalOperatorParser(BaseExpressionParser):
|
||||
parser_input.tokens[start: parsed.end + 1],
|
||||
node)
|
||||
else:
|
||||
return self.parse_names(context, parser_input, error_sink)
|
||||
return self.parse_tokens(context, parser_input, error_sink)
|
||||
|
||||
@staticmethod
|
||||
def stop_condition(token, parser_input):
|
||||
def parse_tokens_stop_condition(self, token, parser_input):
|
||||
return token.type == TokenKind.IDENTIFIER and token.value in ("and", "or") or \
|
||||
token.value == "not" and parser_input.the_token_after(True).value != "in"
|
||||
|
||||
def parse_names(self, context, parser_input, error_sink):
|
||||
return self.inner_parse_names(context, parser_input, error_sink, self.stop_condition)
|
||||
|
||||
def compile_conjunctions(self, context, conjunctions, who):
|
||||
"""
|
||||
Transform a list of conjunctions (AND and OR) into one or multiple CompiledExpr
|
||||
|
||||
Reference in New Issue
Block a user