|
From: | Dmitry Gutov |
Subject: | bug#61529: 30.0.50; tree-sitter: weird off-by-one error but only in css-ts-mode(?) with `treesit-node-at' |
Date: | Thu, 16 Feb 2023 23:26:06 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
On 15/02/2023 21:01, Mickey Petersen wrote:
I read and interpreted it to mean that due to how node boundaries work that "*end is at* or after POS" to mean that point is wholly contained in the node "(" which, due to how tree-sitter determines node extents, it technically isn't. But I think it's fair enough if this is intentional -- I've no real suggestions for improving its behaviour if this is intended. So if it's working as expected, then it's safe to close the issue.
The difference in this case is due to the tree structure:In '210deg', (integer_value) is not a leaf node. The only leaf node it has inside is (unit), and that one starts 3 characters later.
In '255', however, (integer_value) *is* a leaf node. And since treesit-node-at looks for leaf nodes, it stops at "(" as documented.
I'd probably calls it a problem with the grammar, but it doesn't seem likely to be fixed, backward compatibility and all.
[Prev in Thread] | Current Thread | [Next in Thread] |