From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63840: 29.0.91; c-ts-mode fails to fontify common C extension Date: Fri, 02 Jun 2023 15:51:53 +0300 Message-ID: <835y86auxi.fsf@gnu.org> References: <87fs7anjwq.fsf.ref@yahoo.com> <87fs7anjwq.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28561"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63840@debbugs.gnu.org To: Po Lu , Yuan Fu , Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 02 14:53:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q54HT-0007H3-3L for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 02 Jun 2023 14:53:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q54HA-000731-DM; Fri, 02 Jun 2023 08:53:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q54H8-00071s-Ib for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2023 08:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q54H8-00058R-Aa for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2023 08:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q54H8-0000Bn-6e for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2023 08:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Jun 2023 12:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63840 X-GNU-PR-Package: emacs Original-Received: via spool by 63840-submit@debbugs.gnu.org id=B63840.1685710335648 (code B ref 63840); Fri, 02 Jun 2023 12:53:02 +0000 Original-Received: (at 63840) by debbugs.gnu.org; 2 Jun 2023 12:52:15 +0000 Original-Received: from localhost ([127.0.0.1]:39313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q54GN-0000AO-2N for submit@debbugs.gnu.org; Fri, 02 Jun 2023 08:52:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q54GL-0000A8-N9 for 63840@debbugs.gnu.org; Fri, 02 Jun 2023 08:52:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q54GF-0004zL-Pd; Fri, 02 Jun 2023 08:52:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PCndJi9pBkxobbQFtg+NZuAud5feOwV0P9wdv1Weots=; b=kAzcQHlCdRss Agq5ZO9UbdDu15FX2H0/530YT4397UMhe1dKhr7JifhIjvmT/H+bbKWYLAMcVxUnyB4I2p8xRxDFc uWVoGtriiVq1N0vuNx9ZpGCnAqDa8jMqtX5jdISYrQHbafudNV0+ntyBscdeooBT6TDvfXvL9Z46f HEzeCLYRlPaZtMjmrMw6FTVx0Qofih+1jRdE57KDpr4oAxcmQdVzJXXP+up4zXVNYjYZ28IjkZswD 9Pf13YZeyHJ/T8F9sGxYFUvGj+ECi3agxDD35HDxsV8c0fOGBeNTyUeYK7xsrcFYZrYD8Ywl/EcK1 xWf4bTsXCjLyiC2R0IDXiQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q54FK-0000Sm-1s; Fri, 02 Jun 2023 08:51:32 -0400 In-Reply-To: <87fs7anjwq.fsf@yahoo.com> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262762 Archived-At: > 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" > > 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?