From: Eli Zaretskii <eliz@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: luangruo@yahoo.com, 63323-done@debbugs.gnu.org
Subject: bug#63323: c-ts-mode does not know about `restrict'
Date: Sun, 07 May 2023 08:14:25 +0300 [thread overview]
Message-ID: <831qjsg1u6.fsf@gnu.org> (raw)
In-Reply-To: <61B53D25-0E51-4B4C-9890-10E9B97E1840@gmail.com> (message from Yuan Fu on Sat, 6 May 2023 15:54:32 -0700)
> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 6 May 2023 15:54:32 -0700
> Cc: luangruo@yahoo.com,
> 63323@debbugs.gnu.org
>
>
>
> > Actually, it looks like we recognize the type qualifiers in C as
> > keywords, via a separate list. So I've just added to that list the
> > two missing qualifiers: 'restrict' and '_Atomic', and that fixes this
> > bug for me.
> >
> > Yuan, is that the right fix? I've installed it on the emacs-29
> > branch.
>
> I check tree-sitter-c’s grammar and it defines type_qualifier [1], so if you move (type_qualifier) @font-lock-type-face out of the check for cpp, if would work. Recognizing them as keywords also works. So both are technically correct. C-mode uses keyword face, so I think your fix is a-ok.
>
> [1] you probably know this, but for completeness:
>
> type_qualifier: $ => choice(
> 'const',
> 'volatile',
> 'restrict',
> '_Atomic'
> ),
Right, they just copied from the C Standard.
Whether we want to stay with qualifiers in keywords or not depends on
whether we thing type qualifiers could or should be fontified
differently from keywords. (What do other IDEs do with C type
qualifiers?) Something to think for the future, I guess.
For now, I'm closing this bug.
prev parent reply other threads:[~2023-05-07 5:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87r0rtkh2j.fsf.ref@yahoo.com>
2023-05-06 8:19 ` bug#63323: c-ts-mode does not know about `restrict' Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-06 10:31 ` Eli Zaretskii
2023-05-06 12:19 ` Eli Zaretskii
2023-05-06 22:54 ` Yuan Fu
2023-05-07 5:14 ` Eli Zaretskii [this message]
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=831qjsg1u6.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=63323-done@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=luangruo@yahoo.com \
/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.