diff options
| author | Eli Zaretskii | 2025-01-14 14:49:27 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2025-01-14 14:49:27 +0200 |
| commit | e633bbfec0fe0fa436026d759132faa47b6b0dc4 (patch) | |
| tree | 8163a6d4d51ebf55b6c07c199fa8869b25e63e2c | |
| parent | d4aeb6bd230c42cf7b773ec9aebd80ad6d928d98 (diff) | |
| download | emacs-e633bbfec0fe0fa436026d759132faa47b6b0dc4.tar.gz emacs-e633bbfec0fe0fa436026d759132faa47b6b0dc4.zip | |
; 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.
| -rw-r--r-- | doc/lispref/parsing.texi | 2 | ||||
| -rw-r--r-- | src/treesit.c | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index 3e44f31c12c..ba7fbca2de9 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi | |||
| @@ -1607,7 +1607,7 @@ that's either a @code{sexp} thing or a @code{sentence} thing, as defined | |||
| 1607 | by some other rule in the alist. | 1607 | by some other rule in the alist. |
| 1608 | 1608 | ||
| 1609 | There are two pre-defined predicates: @code{named} and @code{anonymous}, | 1609 | There are two pre-defined predicates: @code{named} and @code{anonymous}, |
| 1610 | that qualifies named and anonymous nodes, respectively. They can be | 1610 | which qualify, respectively, named and anonymous nodes. They can be |
| 1611 | combined with @code{and} to narrow down the match. | 1611 | combined with @code{and} to narrow down the match. |
| 1612 | 1612 | ||
| 1613 | Here's an example @code{treesit-thing-settings} for C and C++: | 1613 | Here's an example @code{treesit-thing-settings} for C and C++: |
diff --git a/src/treesit.c b/src/treesit.c index 439109e72db..0d878a580eb 100644 --- a/src/treesit.c +++ b/src/treesit.c | |||
| @@ -3733,13 +3733,9 @@ treesit_traverse_match_predicate (TSTreeCursor *cursor, Lisp_Object pred, | |||
| 3733 | return !NILP (calln (pred, lisp_node)); | 3733 | return !NILP (calln (pred, lisp_node)); |
| 3734 | } | 3734 | } |
| 3735 | else if (SYMBOLP (pred) && BASE_EQ (pred, Qnamed)) | 3735 | else if (SYMBOLP (pred) && BASE_EQ (pred, Qnamed)) |
| 3736 | { | 3736 | return ts_node_is_named (node); |
| 3737 | return ts_node_is_named (node); | ||
| 3738 | } | ||
| 3739 | else if (SYMBOLP (pred) && BASE_EQ (pred, Qanonymous)) | 3737 | else if (SYMBOLP (pred) && BASE_EQ (pred, Qanonymous)) |
| 3740 | { | 3738 | return !ts_node_is_named (node); |
| 3741 | return !ts_node_is_named (node); | ||
| 3742 | } | ||
| 3743 | else if (SYMBOLP (pred)) | 3739 | else if (SYMBOLP (pred)) |
| 3744 | { | 3740 | { |
| 3745 | Lisp_Object language = XTS_PARSER (parser)->language_symbol; | 3741 | Lisp_Object language = XTS_PARSER (parser)->language_symbol; |