; Fix wording and coding style of a recent commit

* src/treesit.c (treesit_traverse_match_predicate): Fix style.

* doc/lispref/parsing.texi (User-defined Things): Fix wording.
This commit is contained in:
Eli Zaretskii 2025-01-14 14:49:27 +02:00
parent d4aeb6bd23
commit e633bbfec0
2 changed files with 3 additions and 7 deletions

View file

@ -1607,7 +1607,7 @@ that's either a @code{sexp} thing or a @code{sentence} thing, as defined
by some other rule in the alist.
There are two pre-defined predicates: @code{named} and @code{anonymous},
that qualifies named and anonymous nodes, respectively. They can be
which qualify, respectively, named and anonymous nodes. They can be
combined with @code{and} to narrow down the match.
Here's an example @code{treesit-thing-settings} for C and C++:

View file

@ -3733,13 +3733,9 @@ treesit_traverse_match_predicate (TSTreeCursor *cursor, Lisp_Object pred,
return !NILP (calln (pred, lisp_node));
}
else if (SYMBOLP (pred) && BASE_EQ (pred, Qnamed))
{
return ts_node_is_named (node);
}
return ts_node_is_named (node);
else if (SYMBOLP (pred) && BASE_EQ (pred, Qanonymous))
{
return !ts_node_is_named (node);
}
return !ts_node_is_named (node);
else if (SYMBOLP (pred))
{
Lisp_Object language = XTS_PARSER (parser)->language_symbol;