1.1 --- a/micropython/cmd.py Fri Jun 28 21:17:02 2013 +0200
1.2 +++ b/micropython/cmd.py Sat Jun 29 01:28:12 2013 +0200
1.3 @@ -4,7 +4,7 @@
1.4 Command option processing and other utilities for compiling and testing
1.5 programs.
1.6
1.7 -Copyright (C) 2009 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2009, 2013 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -23,36 +23,14 @@
1.13 from os.path import exists, join
1.14 import micropython
1.15
1.16 -def parse_optimisations(args):
1.17 -
1.18 - "Parse 'args' for optimisation flags."
1.19 -
1.20 - if "-omax" in args:
1.21 - requested_optimisations = micropython.Program.supported_optimisations
1.22 - else:
1.23 - requested_optimisations = []
1.24 - for arg in args:
1.25 - if arg.startswith("-o"):
1.26 - for arg_part in arg[2:].split(","):
1.27 - requested_optimisations.append(arg_part)
1.28 -
1.29 - return requested_optimisations
1.30 -
1.31 -def show_optimisations():
1.32 -
1.33 - "Show available optimisation flags."
1.34 -
1.35 - return ",".join(micropython.Program.supported_optimisations)
1.36 -
1.37 -def program(path, requested_optimisations, verbose=0):
1.38 +def program(path, verbose=0):
1.39
1.40 """
1.41 - Return a program object for the given module search 'path' and
1.42 - 'requested_optimisations'.
1.43 + Return a program object for the given module search 'path'.
1.44 """
1.45
1.46 - i = micropython.Importer(path, verbose, requested_optimisations)
1.47 - p = micropython.Program(i, requested_optimisations)
1.48 + i = micropython.Importer(path, verbose)
1.49 + p = micropython.Program(i)
1.50
1.51 for d in path:
1.52 builtins = join(d, "builtins.py")
1.53 @@ -70,7 +48,6 @@
1.54 'args'.
1.55 """
1.56
1.57 - requested_optimisations = parse_optimisations(args)
1.58 - return program(path, requested_optimisations, "-v" in args)
1.59 + return program(path, "-v" in args)
1.60
1.61 # vim: tabstop=4 expandtab shiftwidth=4