2006-11-28 | paulb | file changeset files shortlog | Introduced ReturnFromFunction and ReturnFromBlock nodes, replacing usage of Return nodes and improving the handling of locals snapshots and return values. Added pop-up elements for certain keywords in the viewer. Expanded operation node support. Tidied the construction of various node representations. Reordered various methods for potentially easier navigation. Expanded tests, adding for2.py: a test of return values within blocks. |
paulb@40 | 1 | #!/usr/bin/env python |
paulb@40 | 2 | |
paulb@40 | 3 | def f(x, y): |
paulb@40 | 4 | if x < y: |
paulb@40 | 5 | return f(x + 1, y) |
paulb@40 | 6 | else: |
paulb@40 | 7 | return x |
paulb@40 | 8 | |
paulb@40 | 9 | f(3, 20) |
paulb@40 | 10 | |
paulb@40 | 11 | # vim: tabstop=4 expandtab shiftwidth=4 |