aboutsummaryrefslogtreecommitdiffstats
path: root/dwasm.py
blob: e404dcaf310b01ce6b602f6a73a10e3c31148ad2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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()