binary-newsreaderusenetqnaptautullifanartsickbeardtvseriesplexswizzinembyseedboxtvdbnzbgetsubtitlewebuiquickboxtraktkodistabletvshows
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
563 B
27 lines
563 B
import pyjsparser
|
|
from space import Space
|
|
import fill_space
|
|
from byte_trans import ByteCodeGenerator
|
|
from code import Code
|
|
from simplex import MakeError
|
|
import sys
|
|
sys.setrecursionlimit(100000)
|
|
|
|
|
|
pyjsparser.parser.ENABLE_JS2PY_ERRORS = lambda msg: MakeError(u'SyntaxError', unicode(msg))
|
|
|
|
|
|
def eval_js_vm(js):
|
|
a = ByteCodeGenerator(Code())
|
|
s = Space()
|
|
a.exe.space = s
|
|
s.exe = a.exe
|
|
|
|
d = pyjsparser.parse(js)
|
|
|
|
a.emit(d)
|
|
fill_space.fill_space(s, a)
|
|
# print a.exe.tape
|
|
a.exe.compile()
|
|
|
|
return a.exe.run(a.exe.space.GlobalObj)
|
|
|