Function: treesit-node-eq

treesit-node-eq is a function defined in treesit.c.

Signature

(treesit-node-eq NODE1 NODE2)

Documentation

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, and returns non-nil if NODE1 and NODE2 refer to the same node in a syntax tree produced by tree-sitter.

View in manual

Source Code

// Defined in /usr/src/emacs/src/treesit.c
{
  if (NILP (node1) || NILP (node2))
    return Qnil;
  CHECK_TS_NODE (node1);
  CHECK_TS_NODE (node2);

  bool same_node = treesit_node_eq (node1, node2);
  return same_node ? Qt : Qnil;
}