Checks if @var{object} is a tree-sitter syntax node.
@end defun
+@cindex compare tree-sitter syntax nodes
+@cindex tree-sitter nodes, comparing
@defun treesit-node-eq node1 node2
-Checks if @var{node1} and @var{node2} are the same node in a syntax
-tree. This function uses the same equivalence metric as @code{equal}.
+Checks if @var{node1} and @var{node2} refer to the same node in a
+tree-sitter syntax tree. This function uses the same equivalence
+metric as @code{equal}. You can also compare nodes using @code{equal}
+(@pxref{Equality Predicates}).
@end defun
@heading Property information
DEFUN ("treesit-node-eq",
Ftreesit_node_eq,
Streesit_node_eq, 2, 2, 0,
- doc: /* Return non-nil if NODE1 and NODE2 are the same node.
+ doc: /* Return non-nil if NODE1 and NODE2 refer to the same node.
If any one of NODE1 and NODE2 is nil, return nil.
-This function uses the same equivalence metric as `equal'. */)
+This function uses the same equivalence metric as `equal', and returns
+non-nil if NODE1 and NODE2 refer to the same node in a syntax tree
+produced by tree-sitter. */)
(Lisp_Object node1, Lisp_Object node2)
{
if (NILP (node1) || NILP (node2))