Fixed #29: Parsers: Implement parsing memoization

Fixed #77 : Parser: ShortTermMemoryParser should be called separately
Fixed #78 : Remove VariableNode usage
Fixed #79 : ConceptManager: Implement compile caching
Fixed #80 : SheerkaExecute : parsers_key is not correctly computed
Fixed #81 : ValidateConceptEvaluator : Validate concept's where and pre clauses right after the parsing
Fixed #82 : SheerkaIsAManager: isa() failed when the set as a body
Fixed #83 : ValidateConceptEvaluator : Support BNF and SYA Concepts
Fixed #84 : ExpressionParser: Implement the parser as a standard parser
Fixed #85 : Services: Give order to services
Fixed #86 : cannot manage smart_get_attr(the short, color)
This commit is contained in:
2021-06-07 21:14:03 +02:00
parent 1059ce25c5
commit 7dcaa9c111
92 changed files with 4263 additions and 1890 deletions
+12 -13
View File
@@ -230,7 +230,7 @@ class CC:
self.exclude_body,
**compiled)
raise NotImplementedError(f"CC, {other=}")
raise Exception(f"Expecting Concept but received {other=}")
class CB:
@@ -269,7 +269,7 @@ class CB:
body = other.body
return CB(concept, body)
raise NotImplementedError(f"CB, {other=}")
raise Exception(f"Expecting Concept but received {other=}")
class CV:
@@ -310,7 +310,7 @@ class CV:
values = get_test_obj_delegate(other.values(), self.values, get_test_obj_delegate)
return CV(concept, **values)
raise NotImplementedError(f"CV, {other=}")
raise Exception(f"Expecting Concept but received {other=}")
class CMV:
@@ -361,7 +361,7 @@ class CMV:
variables = {name: value for name, value in other.get_metadata().variables}
return CMV(concept, **variables)
raise NotImplementedError(f"CMV, {other=}")
raise Exception(f"Expecting Concept but received {other=}")
class CIO:
@@ -408,7 +408,7 @@ class CIO:
if isinstance(other, Concept):
return CIO(other)
raise NotImplementedError(f"CIO, {other=}")
raise Exception(f"Expecting Concept but received {other=}")
class HelperWithPos:
@@ -496,7 +496,7 @@ class SCN(HelperWithPos):
other.start if self.start is not None else None,
other.end if self.end is not None else None)
raise NotImplementedError(f"SCN, {other=}")
raise Exception(f"Expecting SourceCodeNode but received {other=}")
class SCWC(HelperWithPos):
@@ -572,7 +572,7 @@ class SCWC(HelperWithPos):
res.end = other.end
return res
raise NotImplementedError(f"SCWC, {other=}")
raise Exception(f"Expecting SourceCodeWithConceptNode but received {other=}")
@property
def source(self):
@@ -663,7 +663,7 @@ class CN(HelperWithPos):
other.start if self.start is not None else None,
other.end if self.end is not None else None)
raise NotImplementedError(f"CN, {other=}")
raise Exception(f"Expecting ConceptNode but received {other=}")
class CNC(CN):
@@ -737,8 +737,7 @@ class CNC(CN):
other.end if self.end is not None else None,
self.exclude_body,
**compiled)
raise NotImplementedError(f"CNC, {other=}")
raise Exception(f"Expecting ConceptNode but received {other=}")
class UTN(HelperWithPos):
@@ -799,7 +798,7 @@ class UTN(HelperWithPos):
other.start,
other.end)
raise NotImplementedError(f"UTN, {other=}")
raise Exception(f"Expecting UnrecognizedTokensNode but received {other=}")
class RN(HelperWithPos):
@@ -863,7 +862,7 @@ class RN(HelperWithPos):
other.start if self.start is not None else None,
other.end if self.end is not None else None)
raise NotImplementedError(f"RN, {other=}")
raise Exception(f"Expecting RuleNode but received {other=}")
class FN:
@@ -930,7 +929,7 @@ class FN:
return FN(other.first.value, other.last.value, params)
raise NotImplementedError(f"FN, {other=}")
raise Exception(f"Expecting FunctionNode but received {other=}")
@dataclass()