From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Po Lu <luangruo@yahoo.com>,
63840@debbugs.gnu.org, Theodor Thornhill <theo@thornhill.no>
Subject: bug#63840: 29.0.91; c-ts-mode fails to fontify common C extension
Date: Thu, 8 Jun 2023 00:18:17 -0700 [thread overview]
Message-ID: <692BAB16-A7DD-4080-871A-FB541329CCFC@gmail.com> (raw)
In-Reply-To: <835y86auxi.fsf@gnu.org>
> On Jun 2, 2023, at 5:51 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> Date: Fri, 02 Jun 2023 20:11:33 +0800
>> From: Po Lu via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> A common extension to the C language is the use of the `$' sign inside
>> external identifier names.
>>
>> This is permitted by GNU CC on most systems it supports, and also
>> supported by CC Mode. However, it does not work on c-ts-mode:
>>
>> sl$loadarena ()
>> {
>> struct FAB fab;
>> register int status;
>> extern char *sl$dfname;
>>
>> fab = cc$rms_fab;
>> fab.fab$b_fac = FAB$M_BIO | FAB$M_GET;
>> fab.fab$l_fna = sl$dfname;
>> fab.fab$b_fns = strlen (sl$dfname);
>> status = sys$open (&fab);
>> if (status != RMS$_NORMAL)
>> return status;
>> /* More code below. */
>> }
>>
>> in the identifier name of this function declarator, `sl' is fontified as
>> a type. `$' is not fontified at all. `loadarena' is fontified as an
>> identifier name, as it should be. In:
>>
>> extern char *sl$defname;
>>
>> only `dfname' is fontified as a variable name; in CC Mode, all
>> fontification is correct.
>>
>> This should be a simple change in c-ts-mode's identifier fontifying
>> regexp to include `$', right? I don't know enough about tree-sitter to
>> fix it myself.
>
> I'm not sure this can be fixed unless the tree-sitter's C grammar
> supports such identifiers, but if we can fix it in our code, we
> should.
>
> Yuan and Theo, can you please look into this?
Yeah. So is this the only way $ is used in C? Could it appear in contexts other than identifiers?
Yuan
next prev parent reply other threads:[~2023-06-08 7:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87fs7anjwq.fsf.ref@yahoo.com>
2023-06-02 12:11 ` bug#63840: 29.0.91; c-ts-mode fails to fontify common C extension Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-02 12:51 ` Eli Zaretskii
2023-06-08 7:18 ` Yuan Fu [this message]
2023-06-08 8:50 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-15 5:56 ` Eli Zaretskii
2023-06-16 5:05 ` Yuan Fu
2023-06-16 6:31 ` Eli Zaretskii
2023-06-19 6:43 ` Yuan Fu
2023-06-19 16:23 ` Eli Zaretskii
2023-06-27 5:54 ` Yuan Fu
2023-06-27 11:05 ` Eli Zaretskii
2023-06-28 1:46 ` Yuan Fu
2023-06-28 2:33 ` Eli Zaretskii
2023-10-01 21:10 ` Stefan Kangas
2023-10-02 5:55 ` Eli Zaretskii
2023-10-02 6:44 ` Stefan Kangas
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=692BAB16-A7DD-4080-871A-FB541329CCFC@gmail.com \
--to=casouri@gmail.com \
--cc=63840@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=luangruo@yahoo.com \
--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.