diff options
| author | Yuan Fu | 2022-11-09 14:50:39 -0800 |
|---|---|---|
| committer | Yuan Fu | 2022-11-09 15:51:13 -0800 |
| commit | eecc2d45b94513ba95789dfe0ef58aeb8b029049 (patch) | |
| tree | 70c306db02d75c96ecff258020fc608ae0b0f6f7 /admin/notes/tree-sitter/html-manual/Retrieving-Node.html | |
| parent | 663d768d44be150439a58cd858615cac3c1f572f (diff) | |
| download | emacs-eecc2d45b94513ba95789dfe0ef58aeb8b029049.tar.gz emacs-eecc2d45b94513ba95789dfe0ef58aeb8b029049.zip | |
; Update tree-sitter HTML manuals in admin/notes
* admin/notes/tree-sitter/html-manual/Language-Definitions.html
* admin/notes/tree-sitter/html-manual/Multiple-Languages.html
* admin/notes/tree-sitter/html-manual/Parser_002dbased-Font-Lock.html
* admin/notes/tree-sitter/html-manual/Parser_002dbased-Indentation.html
* admin/notes/tree-sitter/html-manual/Retrieving-Node.html: Update.
Diffstat (limited to 'admin/notes/tree-sitter/html-manual/Retrieving-Node.html')
| -rw-r--r-- | admin/notes/tree-sitter/html-manual/Retrieving-Node.html | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/admin/notes/tree-sitter/html-manual/Retrieving-Node.html b/admin/notes/tree-sitter/html-manual/Retrieving-Node.html index e1de2007077..0c086dab91d 100644 --- a/admin/notes/tree-sitter/html-manual/Retrieving-Node.html +++ b/admin/notes/tree-sitter/html-manual/Retrieving-Node.html | |||
| @@ -262,10 +262,9 @@ is non-<code>nil</code>, it looks for smallest named child. | |||
| 262 | <dd><p>This function traverses the subtree of <var>node</var> (including | 262 | <dd><p>This function traverses the subtree of <var>node</var> (including |
| 263 | <var>node</var> itself), looking for a node for which <var>predicate</var> | 263 | <var>node</var> itself), looking for a node for which <var>predicate</var> |
| 264 | returns non-<code>nil</code>. <var>predicate</var> is a regexp that is matched | 264 | returns non-<code>nil</code>. <var>predicate</var> is a regexp that is matched |
| 265 | (case-insensitively) against each node’s type, or a predicate function | 265 | against each node’s type, or a predicate function that takes a node |
| 266 | that takes a node and returns non-<code>nil</code> if the node matches. The | 266 | and returns non-<code>nil</code> if the node matches. The function returns |
| 267 | function returns the first node that matches, or <code>nil</code> if none | 267 | the first node that matches, or <code>nil</code> if none does. |
| 268 | does. | ||
| 269 | </p> | 268 | </p> |
| 270 | <p>By default, this function only traverses named nodes, but if <var>all</var> | 269 | <p>By default, this function only traverses named nodes, but if <var>all</var> |
| 271 | is non-<code>nil</code>, it traverses all the nodes. If <var>backward</var> is | 270 | is non-<code>nil</code>, it traverses all the nodes. If <var>backward</var> is |
| @@ -279,9 +278,9 @@ down the tree. | |||
| 279 | <dt id="index-treesit_002dsearch_002dforward"><span class="category">Function: </span><span><strong>treesit-search-forward</strong> <em>start predicate &optional backward all</em><a href='#index-treesit_002dsearch_002dforward' class='copiable-anchor'> ¶</a></span></dt> | 278 | <dt id="index-treesit_002dsearch_002dforward"><span class="category">Function: </span><span><strong>treesit-search-forward</strong> <em>start predicate &optional backward all</em><a href='#index-treesit_002dsearch_002dforward' class='copiable-anchor'> ¶</a></span></dt> |
| 280 | <dd><p>Like <code>treesit-search-subtree</code>, this function also traverses the | 279 | <dd><p>Like <code>treesit-search-subtree</code>, this function also traverses the |
| 281 | parse tree and matches each node with <var>predicate</var> (except for | 280 | parse tree and matches each node with <var>predicate</var> (except for |
| 282 | <var>start</var>), where <var>predicate</var> can be a (case-insensitive) regexp | 281 | <var>start</var>), where <var>predicate</var> can be a regexp or a function. |
| 283 | or a function. For a tree like the below where <var>start</var> is marked | 282 | For a tree like the below where <var>start</var> is marked S, this function |
| 284 | S, this function traverses as numbered from 1 to 12: | 283 | traverses as numbered from 1 to 12: |
| 285 | </p> | 284 | </p> |
| 286 | <div class="example"> | 285 | <div class="example"> |
| 287 | <pre class="example"> 12 | 286 | <pre class="example"> 12 |
| @@ -336,8 +335,8 @@ as in <code>treesit-search-forward</code>. | |||
| 336 | <p>It takes the subtree under <var>root</var>, and combs it so only the nodes | 335 | <p>It takes the subtree under <var>root</var>, and combs it so only the nodes |
| 337 | that match <var>predicate</var> are left. Like previous functions, the | 336 | that match <var>predicate</var> are left. Like previous functions, the |
| 338 | <var>predicate</var> can be a regexp string that matches against each | 337 | <var>predicate</var> can be a regexp string that matches against each |
| 339 | node’s type case-insensitively, or a function that takes a node and | 338 | node’s type, or a function that takes a node and return non-<code>nil</code> |
| 340 | return non-<code>nil</code> if it matches. | 339 | if it matches. |
| 341 | </p> | 340 | </p> |
| 342 | <p>For example, for a subtree on the left that consist of both numbers | 341 | <p>For example, for a subtree on the left that consist of both numbers |
| 343 | and letters, if <var>predicate</var> is “letter only”, the returned tree | 342 | and letters, if <var>predicate</var> is “letter only”, the returned tree |