diff options
author | bloodstalker <thabogre@gmail.com> | 2018-06-26 10:36:55 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2018-06-26 10:36:55 +0000 |
commit | 26e2a879bdefafee3bff0a41e1167cbf29b3ab3f (patch) | |
tree | 7107b6666e8f39c00bf34abc70eb47926789e5be /dwasm.py | |
parent | Initial commit (diff) | |
download | dwasm-26e2a879bdefafee3bff0a41e1167cbf29b3ab3f.tar.gz dwasm-26e2a879bdefafee3bff0a41e1167cbf29b3ab3f.zip |
first commit
Diffstat (limited to '')
-rwxr-xr-x | dwasm.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/dwasm.py b/dwasm.py new file mode 100755 index 0000000..e404dca --- /dev/null +++ b/dwasm.py @@ -0,0 +1,33 @@ +#!/usr/bin/python3 + +import argparse +import code +import readline +import signal +import sys +from parse import Argparser, premain, SigHandler_SIGINT,PythonInterpreter +from utils import ParseFlags + +def getWASMModule(): + module_path = sys.argv[1] + interpreter = PythonInterpreter() + module = interpreter.parse(module_path) + +def main(): + signal.signal(signal.SIGINT, SigHandler_SIGINT) + argparser = Argparser() + if argparser.args.dbg: + try: + premain(argparser) + except Exception as e: + print(e.__doc__) + if e.message: print(e.message) + variables = globals().copy() + variables.update(locals()) + shell = code.InteractiveConsole(variables) + shell.interact(banner="DEVIWASM REPL") + else: + premain(argparser) + +if __name__ == "__main__": + main() |