1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

; * src/treesit.c (Ftreesit_node_parent): Improve commentary.

This commit is contained in:
Eli Zaretskii 2023-08-18 09:19:59 +03:00
parent fac0e2d533
commit f6ebd1ef0d

View File

@ -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;