Fixed #127 : SyaNodeParser : Allow tokens parsing

Fixed #128 : parser_utils.get_node() : Refactor
This commit is contained in:
2021-09-12 11:26:14 +02:00
parent 945807b375
commit a61a1c0d2b
12 changed files with 327 additions and 290 deletions
@@ -1152,7 +1152,7 @@ class SheerkaConceptManager(BaseService):
:return:
"""
if token.type == TokenKind.WHITESPACE:
if token.type in (TokenKind.WHITESPACE, TokenKind.EXPR):
return None
if token.type == TokenKind.STRING:
+4 -1
View File
@@ -169,7 +169,10 @@ class ParserInput:
return True
def is_empty(self):
if self.text.strip() == "":
if self.text is not None and self.text.strip() == "":
return True
if self.from_tokens and len(self.tokens) == 0:
return True
if self.end == self.start: