Enhanced PythonEvaluator to accept concepts

This commit is contained in:
2019-11-21 11:52:15 +01:00
parent cb6be9fec7
commit 714f4f5dd0
20 changed files with 964 additions and 208 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
from core.builtin_concepts import BuiltinConcepts, ReturnValueConcept
from core.concept import ConceptParts
import core.builtin_helpers
from parsers.BaseParser import BaseParser, Node, NopNode, ErrorNode, NotInitializedNode
from core.tokenizer import Tokenizer, TokenKind, Token, Keywords
from dataclasses import dataclass, field
@@ -409,8 +410,8 @@ class DefaultParser(BaseParser):
continue
# ask the other parsers if they recognize the tokens
new_context = self.context.push(self)
parsing_result = self.sheerka.expect_one(new_context, self.sheerka.parse(new_context, tokens))
new_context = self.context.push(self.name)
parsing_result = core.builtin_helpers.expect_one(new_context, self.sheerka.parse(new_context, tokens))
if not parsing_result.status:
self.add_error(parsing_result.value)
continue