mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-01 01:41:01 -08:00
ts_node_parent has bugs (bug#60054), using cursor API avoids that. Tree-sitter's author might remove ts_node_parent in the future, so might as well switch to use cursors now. We are basically reimplementing some of the logic of ts_node_prev_sibling and ts_node_parent in the sibling helper and cursor helper functions. See also https://github.com/tree-sitter/tree-sitter/issues/1992 * src/treesit.c (treesit_traverse_sibling_helper) (treesit_traverse_child_helper) (treesit_traverse_match_predicate): Reimplemented to use the cursor API. (treesit_search_dfs) (treesit_search_forward): Use the new cursor helper functions. (Ftreesit_search_subtree) (Ftreesit_search_forward) (Ftreesit_induce_sparse_tree): Use cursors. * test/src/treesit-tests.el (treesit-search-subtree): New test. (treesit--ert-search-setup): New macro. (treesit-search-forward) (treesit-search-forward-named-only) (treesit-search-backward) (treesit-search-backward-named-only) (treesit-cursor-helper-with-missing-node): New tests. |
||
|---|---|---|
| .. | ||
| comp-resources | ||
| emacs-module-resources | ||
| lread-resources | ||
| regex-resources | ||
| syntax-resources | ||
| alloc-tests.el | ||
| buffer-tests.el | ||
| callint-tests.el | ||
| callproc-tests.el | ||
| casefiddle-tests.el | ||
| character-tests.el | ||
| charset-tests.el | ||
| chartab-tests.el | ||
| cmds-tests.el | ||
| coding-tests.el | ||
| comp-tests.el | ||
| data-tests.el | ||
| decompress-tests.el | ||
| doc-tests.el | ||
| editfns-tests.el | ||
| emacs-module-tests.el | ||
| emacs-tests.el | ||
| eval-tests.el | ||
| fileio-tests.el | ||
| filelock-tests.el | ||
| floatfns-tests.el | ||
| fns-tests.el | ||
| font-tests.el | ||
| image-tests.el | ||
| indent-tests.el | ||
| inotify-tests.el | ||
| json-tests.el | ||
| keyboard-tests.el | ||
| keymap-tests.el | ||
| lcms-tests.el | ||
| lread-tests.el | ||
| marker-tests.el | ||
| minibuf-tests.el | ||
| print-tests.el | ||
| process-tests.el | ||
| regex-emacs-tests.el | ||
| search-tests.el | ||
| sqlite-tests.el | ||
| syntax-tests.el | ||
| textprop-tests.el | ||
| thread-tests.el | ||
| timefns-tests.el | ||
| treesit-tests.el | ||
| undo-tests.el | ||
| xdisp-tests.el | ||
| xfaces-tests.el | ||
| xml-tests.el | ||