From 9c8055765849eee39f69a8eda7d2a5aede2b2e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Traunm=C3=BCller?= Date: Tue, 19 Nov 2024 21:24:31 +0100 Subject: [PATCH] docs: add documentation for TSPoint coordinates (#3949) * docs: add documentation for TSPoint coordinates * docs: applied suggestion for TSPoint coordinates documentation --- docs/section-2-using-parsers.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/section-2-using-parsers.md b/docs/section-2-using-parsers.md index 688af1ab..46c39616 100644 --- a/docs/section-2-using-parsers.md +++ b/docs/section-2-using-parsers.md @@ -173,7 +173,9 @@ Tree-sitter provides a [DOM](https://en.wikipedia.org/wiki/Document_Object_Model const char *ts_node_type(TSNode); ``` -Syntax nodes store their position in the source code both in terms of raw bytes and row/column coordinates: +Syntax nodes store their position in the source code both in terms of raw bytes and row/column coordinates. +In a point, rows and columns are zero-based. The `row` field represents the number of newlines before a given +position, while `column` represents the number of bytes between the position and beginning of the line. ```c uint32_t ts_node_start_byte(TSNode);