Fixed RET functionnality misbehaviour

This commit is contained in:
2020-07-08 13:35:18 +02:00
parent c4399d631c
commit b768eaa95d
14 changed files with 113 additions and 29 deletions
-11
View File
@@ -23,14 +23,6 @@ from parsers.BaseParser import BaseParser
PARSERS = ["AtomNode", "SyaNode", "Python"]
# def debug(obj):
# with open("debug.txt", "a") as f:
# f.write(f"{obj}\n")
def debug(obj):
pass
@dataclass
class ParsingContext:
"""
@@ -185,7 +177,6 @@ class ParsingExpression:
return hash((self.rule_name, self.elements))
def parse(self, parser):
debug(self)
# TODO : add memoization
return self._parse(parser)
@@ -590,7 +581,6 @@ class StrMatch(Match):
parser_helper.next_token(self.skip_white_space)
return node
debug(f"Failed to match {self}. {token=}")
return None
@@ -811,7 +801,6 @@ class BnfConceptParserHelper:
self.token = self.parser.parser_input.tokens[self.pos]
# parse
debug(f"parsing {parsing_expression} against '{self.parser.parser_input.text}'")
node = parsing_expression.parse(self)
if isinstance(node, MultiNode):