Debian Codegraph @

rpython/translator/goal/targettestdicts.py

raw symbols SCIP
1 """
2 A simple standalone target.
3
4 The target below specifies None as the argument types list.
5 This is a case treated specially in driver.py . If the list
6 of input types is empty, it is meant to be a list of strings,
7 actually implementing argv of the executable.
8 """
9
10 import os, sys
11
12 def debug(msg):
13 os.write(2, "debug: " + msg + '\n')
14
15 # __________ Entry point __________
16
17 test_dict = dict(map(lambda x: (x, hex(x)), range(256, 4096)))
18 reverse_dict = dict(map(lambda (x,y): (y,x), test_dict.items()))
19
20 def entry_point(argv):
21 if argv[1] == 'd':
22 print test_dict[int(argv[2])]
23 else:
24 print reverse_dict[argv[2]]
25 return 0
26
27 # _____ Define and setup target ___
28
29 def target(*args):
30 return entry_point, None