2008-08-03 | Paul Boddie | file changeset files shortlog | Changed the treatment of boolean status (for tests and conditional jumps) such that a special status register would be involved and that the current value would be preserved. Added a LoadBoolean instruction, which loads the boolean status into the current value (using the appropriate object). Changed temporary storage usage for lambda definitions with default values, removing the ensure_temp method. Re-introduced and cleaned up temporary storage usage (and local usage) attributes for program units. |
paul@96 | 1 | #!/usr/bin/env python |
paul@96 | 2 | |
paul@96 | 3 | import imported |
paul@96 | 4 | |
paul@108 | 5 | imported.attr # cannot assign to this |
paul@96 | 6 | |
paul@96 | 7 | m = imported |
paul@108 | 8 | imported.a # cannot assign to this |
paul@108 | 9 | m.a # cannot assign to this (m is known) |
paul@96 | 10 | |
paul@96 | 11 | class C: # hack: make an attribute called y known to the system |
paul@96 | 12 | y = None # hack: this prevents compilation errors with the statements |
paul@96 | 13 | # hack: below |
paul@96 | 14 | |
paul@96 | 15 | n = None |
paul@96 | 16 | n = imported |
paul@108 | 17 | n.a = 1 # not detected due to reassignment of n |
paul@96 | 18 | n.y = 2 # not detected due to reassignment of n |
paul@96 | 19 | n.y = 3 # not detected due to reassignment of n |
paul@96 | 20 | |
paul@96 | 21 | # vim: tabstop=4 expandtab shiftwidth=4 |