""" Functions for using this module from CLI """ import sys from .utils import our_process from .compiler import module def main(source: str, sink: str) -> int: """ Main method """ with open(source, 'r') as fil: code_py = fil.read() our_module = our_process(code_py, source) wasm_module = module(our_module) code_wat = wasm_module.to_wat() with open(sink, 'w') as fil: fil.write(code_wat) return 0 if __name__ == '__main__': sys.exit(main(*sys.argv[1:])) # pylint: disable=E1120