Debian Codegraph @

rpython/jit/tl/targettiny2.py

raw symbols SCIP
1 from __future__ import print_function
2
3 from rpython.annotator.policy import AnnotatorPolicy
4 from rpython.jit.tl import tiny2
5 from rpython.jit.backend.hlinfo import highleveljitinfo
6
7
8 def entry_point(args):
9 """Main entry point of the stand-alone executable:
10 takes a list of strings and returns the exit code.
11 """
12 # store args[0] in a place where the JIT log can find it (used by
13 # viewcode.py to know the executable whose symbols it should display)
14 highleveljitinfo.sys_executable = args[0]
15 if len(args) < 2:
16 print("Invalid command line arguments.")
17 print(args[0] + " 'tiny2 program string' arg0 [arg1 [arg2 [...]]]")
18 return 1
19 bytecode = [s for s in args[1].split(' ') if s != '']
20 args = [tiny2.StrBox(arg) for arg in args[2:]]
21 res = tiny2.interpret(bytecode, args)
22 print(tiny2.repr(res))
23 return 0
24
25 def target(driver, args):
26 return entry_point, None