Improved PythonEvaluator when dealing with concept class

This commit is contained in:
2020-05-20 04:19:19 +02:00
parent 95dc147bbd
commit d357329f51
16 changed files with 288 additions and 89 deletions
+4 -3
View File
@@ -72,11 +72,12 @@ class PythonParser(BaseParser):
tree = None
python_switcher = {
TokenKind.CONCEPT: lambda t: core.utils.encode_concept(t.value, True)
TokenKind.CONCEPT: lambda t: core.utils.encode_concept(t.value)
}
try:
source = self.get_input_as_text(parser_input, python_switcher)
tracker = {}
source = self.get_input_as_text(parser_input, python_switcher, tracker)
source = source.strip()
parser_input = parser_input if isinstance(parser_input, str) else source
@@ -108,7 +109,7 @@ class PythonParser(BaseParser):
BuiltinConcepts.PARSER_RESULT,
parser=self,
source=parser_input,
body=PythonNode(parser_input, tree),
body=PythonNode(parser_input, tree, tracker),
try_parsed=None))
self.log_result(context, parser_input, ret)