2006-07-31 | paulb | file changeset files shortlog | Fixed/improved namespace usage in the annotation process. Changed find_methods to become find_attributes, along with a get_attributes function which knows how to traverse class and object namespaces. Changed the fixer/annotator process methods, introducing process_all methods which accept visitors/simplifiers. Added conditional annotation support, and tentative invocation support, along with locals snapshot support (upon which conditionals depend). Added tentative constant and instance support, along with initialisation of constant attributes. Added Return nodes in most Conditional node sections in order to facilitate locals merging. |
paulb@33 | 1 | import simplify, compiler, sys, os |
paulb@31 | 2 | import fixnames |
paulb@19 | 3 | import annotate |
paulb@19 | 4 | |
paulb@20 | 5 | a = annotate.Annotator() |
paulb@33 | 6 | b = compiler.parseFile(os.path.join("lib", "builtins.py")) |
paul@0 | 7 | m = compiler.parseFile(sys.argv[1]) |
paulb@34 | 8 | vb = builtins_simplifier = simplify.Simplifier(1) |
paulb@33 | 9 | builtins_simplifier.process(b) |
paulb@34 | 10 | v = module_simplifier = simplify.Simplifier() |
paulb@33 | 11 | module_simplifier.process(m) |
paulb@33 | 12 | builtins_fixer = fixnames.Fixer() |
paulb@33 | 13 | builtins_fixer.process_all(builtins_simplifier) |
paulb@33 | 14 | module_fixer = fixnames.Fixer() |
paulb@33 | 15 | module_fixer.process_all(module_simplifier) |
paulb@33 | 16 | rb = builtins_simplifier.result |
paulb@33 | 17 | r = module_simplifier.result |