2010-08-07 | Paul Boddie | file changeset files shortlog | Added some support for HTML reports of program modules, separating the program finalisation out into a separate method of the Program class, in order to avoid obtaining an actual program image, yet removing unneeded parts of a program. Moved code to test for the usage of program sections into the common module, since this is also useful when generating reports. Added AST node annotation documentation. |
paul@232 | 1 | #!/usr/bin/env python |
paul@232 | 2 | |
paul@232 | 3 | a = 1 |
paul@232 | 4 | b = 2 |
paul@232 | 5 | |
paul@232 | 6 | class X: |
paul@232 | 7 | def __contains__(self, other): |
paul@232 | 8 | return 1 |
paul@232 | 9 | |
paul@232 | 10 | x = X() |
paul@232 | 11 | |
paul@232 | 12 | result_1 = 0 |
paul@232 | 13 | result_2 = 2 |
paul@232 | 14 | |
paul@232 | 15 | if a != x != b: |
paul@232 | 16 | result_1 = 1 |
paul@232 | 17 | |
paul@232 | 18 | if a == x != b: |
paul@232 | 19 | result_2 = 0 |
paul@232 | 20 | |
paul@232 | 21 | # vim: tabstop=4 expandtab shiftwidth=4 |