Implement a convenience recursive walk method over a cursor and its descendants.
authorEli Bendersky <eliben@google.com>
Thu, 29 May 2014 02:35:27 +0000 (02:35 +0000)
committerEli Bendersky <eliben@google.com>
Thu, 29 May 2014 02:35:27 +0000 (02:35 +0000)
commit086e5816b034754897e9c91713bdbc98633adea7
tree15f4520737bf261454c28d484c7a8d58bf233131
parentf74aae2c2d4308052c6a70584a018ad6b5d70c0a
Implement a convenience recursive walk method over a cursor and its descendants.

Before r160106 there was a way to recursively visit all descendants of a cursor
via Cursor_visit, but it was removed. Since then, every user needs to
reimplement the recursive descent into get_children.

Adding a walk_preorder() method to Cursor that conveniently implements recursive
walking in a Pythonic way. This also greatly simplifies get_cursor and
get_cursors in tests/cindex/util.py (walk_preorder is now tested through these
utility functions, since they are used in many tests).

llvm-svn: 209793
clang/bindings/python/clang/cindex.py
clang/bindings/python/tests/cindex/util.py