Fixed #30 : Add variable support in BNF concept definition

Fixed #31 : Add regex support in BNF Concept
Fixed #33 : Do not memorize object during restore
This commit is contained in:
2021-02-24 17:23:03 +01:00
parent cac2dad17f
commit 646c428edb
32 changed files with 2107 additions and 360 deletions
+12
View File
@@ -1237,6 +1237,18 @@ as:
assert len(l) > 0
sheerka.save_execution_context = False
def test_i_can_define_a_regex_concept_and_parse_it(self):
sheerka, context = self.init_test().unpack()
res = sheerka.evaluate_user_input("def concept binary from bnf r'[01]+'")
assert len(res) == 1
assert res[0].status
res = sheerka.evaluate_user_input("01001")
assert len(res) == 1
assert res[0].status
assert sheerka.isinstance(res[0].body, "binary")
class TestSheerkaNonRegFile(TestUsingFileBasedSheerka):
def test_i_can_def_several_concepts(self):