From: Yuan Fu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: 59468@debbugs.gnu.org
Subject: bug#59468: 29.0.50; c-ts-mode cannot fontify after macros are encountered
Date: Tue, 22 Nov 2022 17:27:30 -0800 [thread overview]
Message-ID: <88869BE5-43B6-47AE-841E-A726119EDC5E@ucsd.edu> (raw)
In-Reply-To: <87k03n4v0r.fsf@yahoo.com>
Po Lu <luangruo@yahoo.com> writes:
> Yuan Fu <casouri@gmail.com> writes:
>
>> Thanks for these reports! Buuuuut as we’ve seen, tree-sitter really
>> doesn’t handle macros that well. I’ll see what I can do when I find the
>> time, but there really isn’t any good solutions to this (right now, that
>> I can think of). I’m not even sure the author of tree-sitter-c would
>
> Thanks, and too bad. However, one cannot help but wonder how he is
> supposed to write only "post-processed" C.
I think the idea is that most macros are defined like functions, so they
are just parsed as function invocations. Other things can be handled by
tree-sitter’s error recovery to some degree. Not saying this is correct,
but that’s probably the idea.
>> accept changes that try to parse macros: he has made it clear that the
>> purpose of tree-sitter-c is to support post-processed C and leave macros
>> and preprocessor to error-recovery.
>
> I think that attitude of the
> tree-sitter-c developer is extremely nasty.
For the record, because I don’t want to put words into tree-sitter’s
author’s mouth, I came up with this observation from [1], and I could be
wrong. Also, I think it’s more about the limitation of parser-base
approach than about policy.
[1]: https://github.com/tree-sitter/tree-sitter-c/issues/7
Yuan
next prev parent reply other threads:[~2022-11-23 1:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87k03n4v0r.fsf.ref@yahoo.com>
2022-11-22 1:50 ` bug#59468: 29.0.50; c-ts-mode cannot fontify after macros are encountered Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-22 20:11 ` Yuan Fu
2022-11-23 0:41 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23 3:30 ` Eli Zaretskii
2022-11-23 4:13 ` Yuan Fu
2022-11-23 7:36 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23 12:53 ` Eli Zaretskii
2022-11-23 12:43 ` Eli Zaretskii
2022-11-23 1:27 ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-11-24 0:03 ` Yuan Fu
2022-11-24 0:36 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-24 9:19 ` Eli Zaretskii
2022-11-24 10:36 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-24 10:55 ` Eli Zaretskii
2022-11-24 12:12 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-26 2:39 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=88869BE5-43B6-47AE-841E-A726119EDC5E@ucsd.edu \
--to=bug-gnu-emacs@gnu.org \
--cc=59468@debbugs.gnu.org \
--cc=luangruo@yahoo.com \
--cc=yuf011@ucsd.edu \
/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.