from lexer import lex from parser import parse from runner import evaluate from std import _get_debug def main(): print("### neb :)(:") print("version: < 0") idx = 1 while True: inp = input(f"#{idx}> ") if len(inp.strip()) == 0: continue try: lexed = lex(inp, []) if _get_debug(): acc = " ".join([f"{l}" for l in lexed]) print(f" - LEX: {acc}") parsed = parse(lexed, []) if _get_debug(): acc = " ".join([f"{p}" for p in parsed]) print(f" - PARSE: {acc}") ev = evaluate(parsed, []) print(f"=> {ev}") idx += 1 except Exception as e: print(f"panic! {e}") if __name__ == "__main__": main()