emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 f6ebd1ef0d0: ; * src/treesit.c (Ftreesit_node_parent): Improve


From: Eli Zaretskii
Subject: emacs-29 f6ebd1ef0d0: ; * src/treesit.c (Ftreesit_node_parent): Improve commentary.
Date: Fri, 18 Aug 2023 02:20:24 -0400 (EDT)

branch: emacs-29
commit f6ebd1ef0d028fb5d4551e6766ee882538db132a
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    ; * src/treesit.c (Ftreesit_node_parent): Improve commentary.
---
 src/treesit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/treesit.c b/src/treesit.c
index 705ef6af39f..e359f903f28 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -1886,6 +1886,10 @@ Return nil if NODE has no parent.  If NODE is nil, 
return nil.  */)
   TSNode treesit_node = XTS_NODE (node)->node;
   Lisp_Object parser = XTS_NODE (node)->parser;
   TSTreeCursor cursor;
+  /* See the comments to treesit_cursor_helper about the algorithm for
+     finding the parent node.  The complexity is roughly proportional
+     to the square root of the current node's depth in the parse tree,
+     and we punt if the tree is too deep.  */
   if (!treesit_cursor_helper (&cursor, treesit_node, parser))
     return return_value;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]