Refactored sheerka execution flow + Enhanced log management

This commit is contained in:
2019-12-19 21:02:20 +01:00
parent 8dbe2e1b20
commit 5c95d918ad
32 changed files with 942 additions and 308 deletions
+3 -5
View File
@@ -13,7 +13,7 @@ class PythonErrorNode(ErrorNode):
exception: Exception
# def __post_init__(self):
# log.debug("-> PythonErrorNode: " + str(self.exception))
# self.log.debug("-> PythonErrorNode: " + str(self.exception))
@dataclass()
@@ -58,7 +58,7 @@ class PythonParser(BaseParser):
def __init__(self, **kwargs):
BaseParser.__init__(self, "PythonParser")
BaseParser.__init__(self, "Python")
self.source = kwargs.get("source", "<undef>")
def parse(self, context, text):
@@ -87,7 +87,7 @@ class PythonParser(BaseParser):
body=self.error_sink if self.has_error else PythonNode(text, tree),
try_parsed=None))
self.log_result(log, text, ret)
self.log_result(context, text, ret)
return ret
def try_parse_expression(self, text):
@@ -110,8 +110,6 @@ class PythonGetNamesVisitor(ast.NodeVisitor):
def __init__(self):
self.names = set()
log.debug("Searching for names.")
def visit_Name(self, node):
log.debug(f"Found name : {node.id}")
self.names.add(node.id)