JSON-Lang/main.py

19 lines
401 B
Python
Raw Normal View History

2023-03-08 13:35:21 +00:00
from emis_funky_funktions import *
2024-03-17 17:43:15 +00:00
from ir.genir import json_to_ir
from ir.types_ import BUILTINS_CONTEXT
from repl 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()