Improved PythonEvaluator when dealing with concept class
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user