dumb repl

This commit is contained in:
2022-12-03 01:58:45 +01:00
parent ce78d96a9c
commit 5296396107
4 changed files with 18 additions and 3 deletions

16
repl.py Normal file
View File

@ -0,0 +1,16 @@
from ziffers import *
from rich import print
EXIT_CONDITION = ('exit', 'quit', '')
if __name__ == "__main__":
print(f"[purple]== ZIFFERS REPL ==[/purple]")
while True:
expr = input('> ')
if expr not in EXIT_CONDITION:
try:
parse_expression(expr)
except Exception as e:
print(f"[red]Failed:[/red] {e}")
else:
exit()