2012-05-02 | Paul Boddie | file changeset files shortlog | Changed the visitor dispatch to occur through visit methods on the AST nodes. (This requires a modified version of the compiler package.) Added report output support for yield statements and conditional expressions. |
paul@351 | 1 | #!/usr/bin/env python |
paul@351 | 2 | |
paul@351 | 3 | import operator |
paul@351 | 4 | |
paul@351 | 5 | a = 1 |
paul@351 | 6 | b = 2 |
paul@351 | 7 | c = operator.add(a, b) |
paul@351 | 8 | d = operator.add(operator.add(a, b), c) |
paul@351 | 9 | |
paul@351 | 10 | result_3 = c |
paul@351 | 11 | result_6 = d |
paul@351 | 12 | |
paul@351 | 13 | # vim: tabstop=4 expandtab shiftwidth=4 |