Point#

class tree_sitter.Point(row, column)#

Bases: tuple

A position in a multi-line text document, in terms of rows and columns.

Methods#

edit(start_byte, old_end_byte, new_end_byte, start_point, old_end_point, new_end_point)#

Edit this point to keep it in-sync with source code that has been edited.

Returns:

The edited point and its new start byte.

Tip

This is useful for editing points without requiring a tree or node instance.

Added in version 0.26.0.

Special Methods#

__repr__()#

Implements repr(self).

Attributes#

column#

The zero-based column of the document.

Note

Measured in bytes.

row#

The zero-based row of the document.