aboutsummaryrefslogtreecommitdiffstats
path: root/admin/notes/tree-sitter/html-manual/Retrieving-Node.html
diff options
context:
space:
mode:
authorYuan Fu2022-11-09 14:50:39 -0800
committerYuan Fu2022-11-09 15:51:13 -0800
commiteecc2d45b94513ba95789dfe0ef58aeb8b029049 (patch)
tree70c306db02d75c96ecff258020fc608ae0b0f6f7 /admin/notes/tree-sitter/html-manual/Retrieving-Node.html
parent663d768d44be150439a58cd858615cac3c1f572f (diff)
downloademacs-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.html17
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>
264returns non-<code>nil</code>. <var>predicate</var> is a regexp that is matched 264returns non-<code>nil</code>. <var>predicate</var> is a regexp that is matched
265(case-insensitively) against each node&rsquo;s type, or a predicate function 265against each node&rsquo;s type, or a predicate function that takes a node
266that takes a node and returns non-<code>nil</code> if the node matches. The 266and returns non-<code>nil</code> if the node matches. The function returns
267function returns the first node that matches, or <code>nil</code> if none 267the first node that matches, or <code>nil</code> if none does.
268does.
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>
271is non-<code>nil</code>, it traverses all the nodes. If <var>backward</var> is 270is 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 &amp;optional backward all</em><a href='#index-treesit_002dsearch_002dforward' class='copiable-anchor'> &para;</a></span></dt> 278<dt id="index-treesit_002dsearch_002dforward"><span class="category">Function: </span><span><strong>treesit-search-forward</strong> <em>start predicate &amp;optional backward all</em><a href='#index-treesit_002dsearch_002dforward' class='copiable-anchor'> &para;</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
281parse tree and matches each node with <var>predicate</var> (except for 280parse 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.
283or a function. For a tree like the below where <var>start</var> is marked 282For a tree like the below where <var>start</var> is marked S, this function
284S, this function traverses as numbered from 1 to 12: 283traverses 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
337that match <var>predicate</var> are left. Like previous functions, the 336that 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
339node&rsquo;s type case-insensitively, or a function that takes a node and 338node&rsquo;s type, or a function that takes a node and return non-<code>nil</code>
340return non-<code>nil</code> if it matches. 339if 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
343and letters, if <var>predicate</var> is &ldquo;letter only&rdquo;, the returned tree 342and letters, if <var>predicate</var> is &ldquo;letter only&rdquo;, the returned tree