JSON-Lang/main.py

19 lines
402 B
Python
Raw Normal View History

2023-03-08 13:35:21 +00:00
from emis_funky_funktions import *
from genir import json_to_ir
2023-03-09 22:00:54 +00:00
from types_ import BUILTINS_CONTEXT
2023-03-08 16:50:03 +00:00
from silly_thing import repl, repl_expr
2023-03-08 13:35:21 +00:00
import json, sys
2023-03-08 16:50:03 +00:00
def main():
match sys.argv:
case [_, file]:
2023-03-09 22:00:54 +00:00
# TODO handle this
expr, ty, substs = unwrap_r(json_to_ir(json.loads(open(sys.argv[1]).read()), BUILTINS_CONTEXT))
repl_expr(expr)
2023-03-08 16:50:03 +00:00
case _:
repl()
if __name__ == '__main__':
main()