From: Dmitry Gutov <dgutov@yandex.ru>
To: Mickey Petersen <mickey@masteringemacs.org>,
Theodor Thornhill <theo@thornhill.no>
Cc: Eli Zaretskii <eliz@gnu.org>, 61529@debbugs.gnu.org
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 [thread overview]
Message-ID: <2263f8ab-5d76-9a2c-b34d-4532c9ad5645@yandex.ru> (raw)
In-Reply-To: <87cz6akakn.fsf@masteringemacs.org>
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.
next prev parent reply other threads:[~2023-02-16 21:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 8:25 bug#61529: 30.0.50; tree-sitter: weird off-by-one error but only in css-ts-mode(?) with `treesit-node-at' Mickey Petersen
2023-02-15 13:42 ` Eli Zaretskii
2023-02-15 13:42 ` Mickey Petersen
2023-02-15 18:35 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-15 19:01 ` Mickey Petersen
2023-02-15 19:42 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-16 19:48 ` Mickey Petersen
2023-02-16 21:26 ` Dmitry Gutov [this message]
2023-02-16 21:34 ` Dmitry Gutov
2023-02-17 6:16 ` Eli Zaretskii
2023-02-17 7:24 ` Mickey Petersen
2023-02-17 15:11 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2263f8ab-5d76-9a2c-b34d-4532c9ad5645@yandex.ru \
--to=dgutov@yandex.ru \
--cc=61529@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=mickey@masteringemacs.org \
--cc=theo@thornhill.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.