Added basic implentation for where
This commit is contained in:
@@ -50,6 +50,7 @@ class BuiltinConcepts(Enum):
|
||||
CONCEPT_EVAL_REQUESTED = "concept eval requested"
|
||||
REDUCE_REQUESTED = "reduce requested" # remove meaningless error when possible
|
||||
NOT_A_SET = "not a set" # the concept has no entry in sets
|
||||
WHERE_CLAUSE_FAILED = "where clause failed" # failed to validate where clause during evaluation
|
||||
|
||||
NODE = "node"
|
||||
GENERIC_NODE = "generic node"
|
||||
@@ -91,6 +92,7 @@ BuiltinErrors = [str(e) for e in {
|
||||
BuiltinConcepts.CONCEPT_EVAL_ERROR,
|
||||
BuiltinConcepts.CONCEPT_ALREADY_IN_SET,
|
||||
BuiltinConcepts.NOT_A_SET,
|
||||
BuiltinConcepts.WHERE_CLAUSE_FAILED
|
||||
}]
|
||||
|
||||
"""
|
||||
@@ -385,3 +387,20 @@ class ConceptAlreadyInSet(Concept):
|
||||
@property
|
||||
def concept_set(self):
|
||||
return self.props["concept_set"].value
|
||||
|
||||
|
||||
class WhereClauseFailed(Concept):
|
||||
def __init__(self, concept=None):
|
||||
super().__init__(BuiltinConcepts.WHERE_CLAUSE_FAILED,
|
||||
True,
|
||||
False,
|
||||
BuiltinConcepts.WHERE_CLAUSE_FAILED)
|
||||
self.set_metadata_value(ConceptParts.BODY, concept)
|
||||
self.metadata.is_evaluated = True
|
||||
|
||||
def __repr__(self):
|
||||
return f"WhereClauseFailed(concept={self.concept})"
|
||||
|
||||
@property
|
||||
def concept(self):
|
||||
return self.body
|
||||
|
||||
Reference in New Issue
Block a user