1.1 --- a/test.py Sun May 18 19:59:26 2008 +0200
1.2 +++ b/test.py Mon May 19 00:22:00 2008 +0200
1.3 @@ -1,17 +1,31 @@
1.4 #!/usr/bin/env python
1.5
1.6 import micropython
1.7 +from micropython.rsvp import raw
1.8 +import rsvp
1.9 import sys
1.10
1.11 code = None
1.12
1.13 def show(importer, with_builtins=0, optimisations=None):
1.14 + make(importer, with_builtins, optimisations)
1.15 + show_code(code)
1.16 +
1.17 +def make(importer, with_builtins=0, optimisations=None):
1.18 optimisations = optimisations or requested_optimisations
1.19 global code
1.20 code = importer.get_image(with_builtins, optimisations)
1.21 +
1.22 +def show_code(code):
1.23 for i, x in enumerate(code):
1.24 print i, x
1.25
1.26 +def machine(code, code_location):
1.27 + rc = raw(code)
1.28 + rm = rsvp.RSVPMachine(rc)
1.29 + rm.pc = code_location
1.30 + return rm
1.31 +
1.32 def attrs(obj):
1.33 for name, attr in obj.items():
1.34 print name, attr