Initial commit - fix problems & refactor code

This commit is contained in:
2025-12-22 19:10:46 +03:00
commit ff36917cb5
39 changed files with 1499 additions and 0 deletions
@@ -0,0 +1,14 @@
from core.tokens import BinaryPredicate
from core.exceptions import runtimeError
def evalBinaryPredicate(op: BinaryPredicate, a, b):
try:
match op:
case BinaryPredicate.LT:
return a < b
case BinaryPredicate.GT:
return a > b
case BinaryPredicate.EQ:
return a == b
except Exception as e:
raise runtimeError(f'cannot apply {repr(op)} to {repr(a)} and {repr(b)}') from e