Fixed some misbehaviours regarding question() + added #import functionality when restoring

This commit is contained in:
2020-09-23 20:08:15 +02:00
parent 17c74d3808
commit eeeed0f110
20 changed files with 164 additions and 83 deletions
+13
View File
@@ -181,6 +181,7 @@ BuiltinErrors = [str(e) for e in {
BuiltinConcepts.NOT_FOUND,
BuiltinConcepts.INVALID_LESSER_OPERATION,
BuiltinConcepts.INVALID_GREATEST_OPERATION,
# DO NOT PUT NOT_INITIALIZED. It's not an error
}]
"""
@@ -534,3 +535,15 @@ class PythonSecurityError(Concept):
self.set_value("column", column) # column number
self.set_value(ConceptParts.BODY, source_code) # code being executed
self.metadata.is_evaluated = True
class NotFound(Concept):
def __init__(self, body=None):
super().__init__(BuiltinConcepts.NOT_FOUND,
True,
False,
BuiltinConcepts.NOT_FOUND)
self.set_value(ConceptParts.BODY, body)
def __repr__(self):
return f"({self.metadata.id}){self.metadata.name}, body={self.get_value(ConceptParts.BODY)}"