From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#63840: 29.0.91; c-ts-mode fails to fontify common C extension Date: Thu, 8 Jun 2023 00:18:17 -0700 Message-ID: <692BAB16-A7DD-4080-871A-FB541329CCFC@gmail.com> References: <87fs7anjwq.fsf.ref@yahoo.com> <87fs7anjwq.fsf@yahoo.com> <835y86auxi.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28314"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , 63840@debbugs.gnu.org, Theodor Thornhill To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 08 09:19:41 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 1q79vp-00077Y-IC for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Jun 2023 09:19:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q79vQ-0001Wr-0x; Thu, 08 Jun 2023 03:19:16 -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 1q79vP-0001Wj-8r for bug-gnu-emacs@gnu.org; Thu, 08 Jun 2023 03:19:15 -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 1q79vC-0005ng-Pa for bug-gnu-emacs@gnu.org; Thu, 08 Jun 2023 03:19:15 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q79vC-0003uq-Ad for bug-gnu-emacs@gnu.org; Thu, 08 Jun 2023 03:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Jun 2023 07:19: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.168620871815016 (code B ref 63840); Thu, 08 Jun 2023 07:19:02 +0000 Original-Received: (at 63840) by debbugs.gnu.org; 8 Jun 2023 07:18:38 +0000 Original-Received: from localhost ([127.0.0.1]:55541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q79uo-0003u8-7Y for submit@debbugs.gnu.org; Thu, 08 Jun 2023 03:18:38 -0400 Original-Received: from mail-il1-f169.google.com ([209.85.166.169]:54655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q79um-0003tq-2z for 63840@debbugs.gnu.org; Thu, 08 Jun 2023 03:18:36 -0400 Original-Received: by mail-il1-f169.google.com with SMTP id e9e14a558f8ab-33cb82122c7so623595ab.1 for <63840@debbugs.gnu.org>; Thu, 08 Jun 2023 00:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686208710; x=1688800710; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=D7g1IyMSq3t5V4sFuDcumA+li16TDjaw0oU1PNjUey0=; b=aCNR6o/okbmLzIlrvmL7iCHu0a+2vKtCaOs9/0QA0UuFklU2QJZ6EZpCG0uBmPWGig XYh52Dhy1sjoJcTJT3qFf9lq+fstg0BEfU4gIo44CcEWvgPCtRpJi8lrdIHvGMrr0kK/ s4WEh4TYvoQUUOZsnft0glVvOBwni7DDsxRNurXP0Hqsp02i+AWgOWUbFRYPk+q1YL+P Y/y9ulDXoRSecCXq9PbSjVEEw03HyDRAvL7QmBb64vM9laCL32iiRo1vOU1gSkx/yhEm BzAla/4azIYOP3jNPc6bdxYlWj82PHtFHMVnkx0JcmWC0Fe7+VZ7PkSUa60TRTtcokxl GJuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686208710; x=1688800710; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D7g1IyMSq3t5V4sFuDcumA+li16TDjaw0oU1PNjUey0=; b=PcnT2wpG2qWYZyXBAj8eTFaUUDREw5jb4SyZzIZXyn9gPDsc8/NexByhsmGGBEMleX /eZNjSsy0bVQhiGWsEhMt+Bgw8oExXnE/xaf2M9nYGbeTPZ84agxF2e7qIoREUMwxqgT 6GCou2/f8hrpcazwh6DmQst3TtYDiZApVyq3EeWifp7p2mjruYT7NScvwI1EO6y2nB9w Hq69XMlfat5ovpHKfwKxXgq/9qOHTAIaqie4qfm/YehCnoIxs/OqXr/O3kGaYurTG6tl 6Xp7YvfAVKYWMoJDXV5uycIThT+aoFw7Yv9BtSGcHd+/PLLJVN3fbd4KqDs8vg6kNX7M kZ1Q== X-Gm-Message-State: AC+VfDxISOR3BunUGdInb3trdbS1Oio2sgteDdKJiiGzcdzVpJubtxLU jklzKupidz9UCGuyKbw7OwE= X-Google-Smtp-Source: ACHHUZ7xlbxkDVls+Va4JoVDNJUt9+tQo9fN8PxpzB6v5FwB7chy571vpfNgGrlAcC5ZThwX7O9UgA== X-Received: by 2002:a92:c08c:0:b0:33e:7540:1bb7 with SMTP id h12-20020a92c08c000000b0033e75401bb7mr847187ile.7.1686208710177; Thu, 08 Jun 2023 00:18:30 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id bv24-20020a17090af19800b00253239144c5sm604190pjb.42.2023.06.08.00.18.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2023 00:18:29 -0700 (PDT) In-Reply-To: <835y86auxi.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.600.7) 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:263107 Archived-At: > On Jun 2, 2023, at 5:51 AM, Eli Zaretskii wrote: >=20 >> 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" >>=20 >> A common extension to the C language is the use of the `$' sign = inside >> external identifier names. >>=20 >> 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: >>=20 >> sl$loadarena () >> { >> struct FAB fab; >> register int status; >> extern char *sl$dfname; >>=20 >> fab =3D cc$rms_fab; >> fab.fab$b_fac =3D FAB$M_BIO | FAB$M_GET; >> fab.fab$l_fna =3D sl$dfname; >> fab.fab$b_fns =3D strlen (sl$dfname); >> status =3D sys$open (&fab); >> if (status !=3D RMS$_NORMAL) >> return status; >> /* More code below. */ >> } >>=20 >> 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: >>=20 >> extern char *sl$defname; >>=20 >> only `dfname' is fontified as a variable name; in CC Mode, all >> fontification is correct. >>=20 >> 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. >=20 > 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. >=20 > 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=