Add NodeOrLeaf.dump() and NodeOrLeaf.search_ancestor() (#187)

- Add `NodeOrLeaf.dump()` to generate a readable and "round-trippable" dump for a parser tree
- `parso.tree.search_ancestor()` is deprecated, use `NodeOrLeaf.search_ancestor()` instead
- Set up children's parent in `BaseNode.__init__()`
- Add test for `search_ancestor`
- Various small type annotations improvements
This commit is contained in:
Saiyang Gou authored and GitHub committed 2021-05-29 12:40:07 -07:00
1 parent f2b1ff9429
commit 86f3f1096b
11 files changed
+364 -34

No files matched your search

+1
View File
@@ -11,3 +11,4 @@ parso.egg-info/
/.pytest_cache
test/fuzz-redo.pickle
/venv/
/htmlcov/