2008-03-09 | Paul Boddie | raw annotate files changeset graph | Added an Instance class to indicate where instance accesses are being performed. Extended the Const class to hold empty parent/context details. Fixed function local name positions. Added a method to Function to determine whether an attribute is relocated for the class owning the function. Reverted the parameter initialisation "fix" (set_parameter) since parameters are unlikely to be single assignment candidates. Added explicit attribute finalisation in the image generation. Added a tentative optimisation for instance attributes (related to the is_relocated method mentioned above). Added incompatibility notes. |
1 #!/usr/bin/env python 2 3 import micropython 4 import sys 5 6 def show(importer): 7 for i, x in enumerate(importer.get_image()): 8 print i, x 9 10 def attrs(obj): 11 for name, attr in obj.items(): 12 print name, attr 13 14 i = micropython.Importer(sys.path, "-v" in sys.argv) 15 try: 16 if len(sys.argv) < 2: 17 m = i.load("micropython") 18 #m = i.load_from_file("micropython/__init__.py") 19 else: 20 m = i.load_from_file(sys.argv[1]) 21 except micropython.ProcessingError, exc: 22 print repr(exc) 23 else: 24 i.vacuum() 25 ot = i.get_object_table() 26 pt = i.get_parameter_table() 27 28 # vim: tabstop=4 expandtab shiftwidth=4