Fixed RET functionnality misbehaviour
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user