Fixed #131 : Implement ExprToConditions

Fixed #130 : ArithmeticOperatorParser
Fixed #129 : python_wrapper : create_namespace
Fixed #128 : ExpressionParser: Cannot parse func(x) infixed concept 'xxx'
This commit is contained in:
2021-10-13 16:06:57 +02:00
parent a61a1c0d2b
commit 89e1f20975
76 changed files with 5867 additions and 3206 deletions
+15
View File
@@ -2,6 +2,7 @@ import ast
from dataclasses import dataclass, field
from core.builtin_concepts import BuiltinConcepts, ParserResultConcept, ReturnValueConcept
from core.builtin_helpers import evaluate_from_source, expect_one
from core.concept import Concept, DEFINITION_TYPE_BNF, DEFINITION_TYPE_DEF, freeze_concept_attrs
from core.rule import ACTION_TYPE_EXEC, ACTION_TYPE_PRINT, Rule
from core.sheerka.ExecutionContext import ExecutionContext
@@ -306,3 +307,17 @@ class BaseTest:
# the see the logs, do not forget to add
# logs = sheerka.get_debugger_logs()
@staticmethod
def evaluate_from_source(context, source, is_question=False):
res = evaluate_from_source(context,
source,
desc=None,
eval_body=not is_question,
eval_where=False,
is_question=is_question,
expect_success=False,
stm=None)
res = expect_one(context, res)
assert res.status
return res.body