Newer
Older
NewLang / main.py
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
# Copyright 2021 Jookia <contact@jookia.org>

import log
import parse
import interp

def main(args):
    if len(args) != 2:
        print("Usage: main.py FILENAME")
        return 1
    log.set_default_log_level()
    ast = parse.parse_file(args[1])
    if not ast:
        return 1
    interp.run_ast(ast)
    return 0

if __name__ == "__main__":
    import sys
    sys.exit(main(sys.argv))