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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user