1.1 --- a/test.py Tue Oct 28 01:08:06 2008 +0100
1.2 +++ b/test.py Sat Nov 08 21:15:11 2008 +0100
1.3 @@ -9,14 +9,13 @@
1.4
1.5 code = None
1.6
1.7 -def show(importer, with_builtins=0, optimisations=None):
1.8 - make(importer, with_builtins, optimisations)
1.9 +def show(importer, with_builtins=0):
1.10 + make(importer, with_builtins)
1.11 show_code(code)
1.12
1.13 -def make(importer, with_builtins=0, optimisations=None):
1.14 - optimisations = optimisations or requested_optimisations
1.15 +def make(importer, with_builtins=0):
1.16 global code
1.17 - code = importer.get_image(with_builtins, optimisations)
1.18 + code = importer.get_image(with_builtins)
1.19
1.20 def show_code(code):
1.21 for i, x in enumerate(code):
1.22 @@ -28,9 +27,9 @@
1.23 print "%6d" % (len(table_slice) - table_slice.count(None)), \
1.24 "".join(entry and "#" or "_" for entry in table_slice)
1.25
1.26 -def machine(importer, with_builtins=0, optimisations=None, debug=0):
1.27 +def machine(importer, with_builtins=0, debug=0):
1.28 print "Making the image..."
1.29 - make(importer, with_builtins, optimisations)
1.30 + make(importer, with_builtins)
1.31 print "Getting raw structures..."
1.32 ot = importer.get_object_table()
1.33 pt = importer.get_parameter_table()
1.34 @@ -59,10 +58,8 @@
1.35 else:
1.36 program = None
1.37
1.38 - i = micropython.Importer(path, "-v" in args)
1.39 -
1.40 if "-omax" in args:
1.41 - requested_optimisations = i.supported_optimisations
1.42 + requested_optimisations = micropython.Importer.supported_optimisations
1.43 else:
1.44 requested_optimisations = []
1.45 for arg in args:
1.46 @@ -70,6 +67,8 @@
1.47 for arg_part in arg[2:].split(","):
1.48 requested_optimisations.append(arg_part)
1.49
1.50 + i = micropython.Importer(path, requested_optimisations, "-v" in args)
1.51 +
1.52 try:
1.53 builtins = i.load_from_file("lib/builtins.py", "__builtins__")
1.54 if program is None: