1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-01 01:41:01 -08:00
emacs/test/src
Yuan Fu 5f0286c0af
Switch to use cursor API in treesit.c
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.
2022-12-17 15:33:54 -08:00
..
comp-resources ; Fix typos 2022-11-20 12:59:39 +01:00
emacs-module-resources Port better to C23 bool+true+false keywords 2022-09-28 01:09:01 -07:00
lread-resources Make force-load-doc-strings work again 2022-08-07 10:25:03 +02:00
regex-resources
syntax-resources
alloc-tests.el
buffer-tests.el Reduce buffer-tests noisiness even more 2022-11-16 16:37:23 +02:00
callint-tests.el Allow specifying how args are to be stored in `command-history' 2022-08-08 15:53:41 +02:00
callproc-tests.el
casefiddle-tests.el test: Remove redundant "" arg to mapconcat 2022-09-08 16:08:42 -04:00
character-tests.el
charset-tests.el
chartab-tests.el
cmds-tests.el
coding-tests.el Remove redundant local variables in tests 2022-08-08 13:47:15 +02:00
comp-tests.el ; Fix typos 2022-11-20 12:59:39 +01:00
data-tests.el test: Remove redundant "" arg to mapconcat 2022-09-08 16:08:42 -04:00
decompress-tests.el
doc-tests.el
editfns-tests.el
emacs-module-tests.el ; Fix several symbol name typos 2022-10-26 23:04:23 +02:00
emacs-tests.el
eval-tests.el ; Fix typos 2022-11-20 12:59:39 +01:00
fileio-tests.el Fix file-name-case-insensitive-p in ffap (bug#56443) 2022-07-08 15:13:21 +02:00
filelock-tests.el
floatfns-tests.el
fns-tests.el Audit some plist uses with new predicate argument 2022-10-22 19:33:12 +03:00
font-tests.el ; Fix typos 2022-11-18 16:02:19 +01:00
image-tests.el ; Fix warnings in --without-x build 2022-09-23 15:19:00 +02:00
indent-tests.el
inotify-tests.el
json-tests.el Allow NUL characters in JSON input 2022-07-02 15:06:24 +02:00
keyboard-tests.el
keymap-tests.el Signal error on duplicate key definitions 2022-08-02 14:29:43 +02:00
lcms-tests.el ; Prefer HTTPS to HTTP in many URLs 2022-10-15 13:06:45 +02:00
lread-tests.el Prefer pos-bol and pos-eol in tests 2022-08-21 17:45:04 +02:00
marker-tests.el
minibuf-tests.el
print-tests.el test: Remove redundant "" arg to mapconcat 2022-09-08 16:08:42 -04:00
process-tests.el test: Remove redundant "" arg to mapconcat 2022-09-08 16:08:42 -04:00
regex-emacs-tests.el Fix regexp matching with atomic strings and optimised backtracking 2022-10-24 11:50:13 +02:00
search-tests.el
sqlite-tests.el * test/src/sqlite-tests.el (sqlite-version): Declare. 2022-12-07 09:21:23 +01:00
syntax-tests.el
textprop-tests.el
thread-tests.el ; Fix typos 2022-11-18 16:02:19 +01:00
timefns-tests.el Don’t test time functions for NaNs, INF 2022-06-15 23:27:08 -05:00
treesit-tests.el Switch to use cursor API in treesit.c 2022-12-17 15:33:54 -08:00
undo-tests.el Prefer pos-bol and pos-eol in tests 2022-08-21 17:45:04 +02:00
xdisp-tests.el
xfaces-tests.el
xml-tests.el