aboutsummaryrefslogtreecommitdiffstats
path: root/exec/exec.c
diff options
context:
space:
mode:
authorYuan Fu2023-04-13 15:03:05 -0700
committerYuan Fu2023-04-13 15:08:51 -0700
commit361c5fc2d8e52d70aa58956c57eaef9495881197 (patch)
tree31c1573058144e6a70515b0198f1c2e7cf34e8bb /exec/exec.c
parenta5eb9f6ad4e6f5a2819b540a477f1e889f6ef355 (diff)
downloademacs-361c5fc2d8e52d70aa58956c57eaef9495881197.tar.gz
emacs-361c5fc2d8e52d70aa58956c57eaef9495881197.zip
Support more predicates in tree-sitter search functions
Right now we support regexp strings and predicate functions for the PRED argument. This change adds support for (not ...) (or ...) and (regexp . pred) predicates. I still need to find a place to document the supported shapes of a predicate. * src/treesit.c (treesit_traverse_validate_predicate): New function. (treesit_traverse_match_predicate): Support more predicate shapes. (treesit_search_dfs): (treesit_search_forward) (treesit_build_sparse_tree): Fix docstring (unrelated to this change). (Ftreesit_search_subtree) (Ftreesit_search_forward) (Ftreesit_induce_sparse_tree): Use the new function to validate predicate shape. (syms_of_treesit): New error Qtreesit_invalid_predicate. * test/src/treesit-tests.el: (treesit--ert-search-setup): Add edebug declaration. (treesit-search-forward-predicate) (treesit-search-forward-predicate-invalid-predicate): New tests.
Diffstat (limited to 'exec/exec.c')
0 files changed, 0 insertions, 0 deletions