This function traverses the subtree of @var{node} (including
@var{node} itself), looking for a node for which @var{predicate}
returns non-@code{nil}. @var{predicate} is a regexp that is matched
-(case-insensitively) against each node's type, or a predicate function
-that takes a node and returns non-@code{nil} if the node matches. The
-function returns the first node that matches, or @code{nil} if none
-does.
+against each node's type, or a predicate function that takes a node
+and returns non-@code{nil} if the node matches. The function returns
+the first node that matches, or @code{nil} if none does.
By default, this function only traverses named nodes, but if @var{all}
is non-@code{nil}, it traverses all the nodes. If @var{backward} is
@defun treesit-search-forward start predicate &optional backward all
Like @code{treesit-search-subtree}, this function also traverses the
parse tree and matches each node with @var{predicate} (except for
-@var{start}), where @var{predicate} can be a (case-insensitive) regexp
-or a function. For a tree like the below where @var{start} is marked
-S, this function traverses as numbered from 1 to 12:
+@var{start}), where @var{predicate} can be a regexp or a function.
+For a tree like the below where @var{start} is marked S, this function
+traverses as numbered from 1 to 12:
@example
@group
It takes the subtree under @var{root}, and combs it so only the nodes
that match @var{predicate} are left. Like previous functions, the
@var{predicate} can be a regexp string that matches against each
-node's type case-insensitively, or a function that takes a node and
-return non-@code{nil} if it matches.
+node's type, or a function that takes a node and return non-@code{nil}
+if it matches.
For example, for a subtree on the left that consist of both numbers
and letters, if @var{predicate} is ``letter only'', the returned tree
if (STRINGP (pred))
{
const char *type = ts_node_type (node);
- return fast_c_string_match_ignore_case (pred, type, strlen (type)) >= 0;
+ return fast_c_string_match (pred, type, strlen (type)) >= 0;
}
else
{
Traverse the subtree of NODE, and match PREDICATE with each node along
the way. PREDICATE is a regexp string that matches against each
-node's type case-insensitively, or a function that takes a node and
-returns nil/non-nil.
+node's type, or a function that takes a node and returns nil/non-nil.
By default, only traverse named nodes, but if ALL is non-nil, traverse
all nodes. If BACKWARD is non-nil, traverse backwards. If LIMIT is
Start traversing the tree from node START, and match PREDICATE with
each node (except START itself) along the way. PREDICATE is a regexp
-string that matches against each node's type case-insensitively, or a
-function that takes a node and returns non-nil if it matches.
+string that matches against each node's type, or a function that takes
+a node and returns non-nil if it matches.
By default, only search for named nodes, but if ALL is non-nil, search
for all nodes. If BACKWARD is non-nil, search backwards.
This takes the subtree under ROOT, and combs it so only the nodes
that match PREDICATE are left, like picking out grapes on the vine.
-PREDICATE is a regexp string that matches against each node's type
-case-insensitively.
+PREDICATE is a regexp string that matches against each node's type.
For a subtree on the left that consist of both numbers and letters, if
PREDICATE is "is letter", the returned tree is the one on the right.