This commit is contained in:
2024-02-21 15:37:38 +01:00
parent 153216ce63
commit ee2817afbb
11 changed files with 40 additions and 36 deletions

View File

@ -301,7 +301,7 @@ class Call(Statement):
return vtable, ftable, result
class StatementIf(Statement):
class CommandIf(Command):
def __init__(self, statement: Statement, condition):
self.statement = statement
self.condition = condition
@ -316,13 +316,13 @@ class StatementIf(Statement):
else:
return vtable, ftable, result
class StatementBecause(Statement):
class CommandBecause(Command):
def __init__(self, statement: Statement, condition):
self.statement = statement
self.condition = condition
def __repr__(self) -> str:
return f"if({self.statement}, {self.condition})"
return f"because({self.statement}, {self.condition})"
def eval(self, vtable, ftable):
vtable, ftable, result = self.condition.eval(vtable, ftable)
@ -332,7 +332,7 @@ class StatementBecause(Statement):
print("C001: Because assertion incorrect")
exit()
class StatementUntil(Statement):
class CommandUntil(Command):
def __init__(self, statement: Statement, condition):
self.statement = statement
self.condition = condition