Added basic implementation for Python code evaluation

This commit is contained in:
2019-11-07 17:18:07 +01:00
parent b818c992ec
commit 448ebc696a
18 changed files with 501 additions and 156 deletions
+4
View File
@@ -12,6 +12,8 @@ class PythonErrorNode(ErrorNode):
source: str
exception: Exception
def __post_init__(self):
log.debug("-> PythonErrorNode: " + str(self.exception))
@dataclass()
class PythonNode(Node):
@@ -41,6 +43,8 @@ class PythonParser(BaseParser):
error_node = PythonErrorNode(self.text, error)
self.error_sink.append(error_node)
return error_node
log.debug("Recognized python code.")
return PythonNode(self.text, tree)
def try_parse_expression(self):