sameNodeAs method

bool sameNodeAs(
  1. TreeSitterNode other
)

C ts_node_eq, which also requires both handles to belong to one tree.

Implementation

bool sameNodeAs(TreeSitterNode other) {
  if (isNull || other.isNull) return isNull && other.isNull;
  if (!identical(_nativeIdentity, other._nativeIdentity)) return false;
  final tree = _contexts[this]?.tree;
  return tree != null && identical(tree, _contexts[other]?.tree);
}