dumb repl
This commit is contained in:
16
repl.py
Normal file
16
repl.py
Normal 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()
|
||||
Reference in New Issue
Block a user