Working on #48 : Refactored FunctionParser.py

This commit is contained in:
2021-03-11 18:00:50 +01:00
parent f32e14669a
commit 19908b97a6
4 changed files with 22 additions and 46 deletions
+4 -8
View File
@@ -395,18 +395,14 @@ class BaseExpressionParser(BaseParser):
def parse_input(self, context, parser_input, error_sink):
raise NotImplementedError
def inner_parse_names(self, context, parser_input, error_sink, stop_condition):
# 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") or \
# token.value == "not" and parser_input.the_token_after(True).value != "in"
def parse_tokens_stop_condition(self, token, parser_input):
raise NotImplementedError
def parse_tokens(self, context, parser_input, error_sink):
def stop():
return token.type == TokenKind.EOF or \
paren_count == 0 and token.type == TokenKind.RPAR or \
stop_condition(token, parser_input)
self.parse_tokens_stop_condition(token, parser_input)
token = parser_input.token
if token.type == TokenKind.EOF: