Subject: bug#61529: 30.0.50; tree-sitter: weird off-by-one error but only in css-ts-mode(?) with `treesit-node-at'

From: Dmitry Gutov <[email-masked]>
Date: Thu, 16 Feb 2023 23:26:06 +0200

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.