From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: yordanm--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63708: 29.0.60; rust-ts-mode not properly handling apostrophe Date: Sun, 28 May 2023 19:51:42 +0000 Message-ID: <_LWjNGLzmmtpm2gEwOaBZlTVCwvU9yxUyJzIl3yo3ol48dKWbMabBOpLzZ2UhWJ2_yPjVT-j2Jb-oUP8nLaju6ztGjFTNq-2PZqgTjv5gSM=@proton.me> References: <83pm6pm0yz.fsf@gnu.org> <2MdRTHLlZtWDlCx6Ky-LFtla6-aBBs4PlNgTuatIC-h4OIuKdPmsmWsIokUQ9LBMHNvH_ooIvMUlQH8F8XOjNrEUUdC9FtR1l_e6RZSy7xU=@rjt.dev> <837cswmu5a.fsf@gnu.org> <8T8C4l5XryyVmB2cBTnmhGMnoELwHA2y1u1ZeMlg1WaQKzrPeOoe6L5hOQq3JPdsnG9r-puSlQfNZ091qBCGpVco-mC6ruhsQs0SvaPjkjQ=@proton.me> Reply-To: =?UTF-8?Q?=D0=99=D0=BE=D1=80=D0=B4=D0=B0=D0=BD_?= =?UTF-8?Q?=D0=9C=D0=B8=D0=BB=D0=B0=D0=B4=D0=B8=D0=BD=D0=BE=D0=B2?= Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26894"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 63708@debbugs.gnu.org, casouri@gmail.com To: Randy Taylor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 28 21:52:26 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 1q3MRE-0006m3-Rp for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 May 2023 21:52:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3MQu-0001w0-2i; Sun, 28 May 2023 15:52: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 1q3MQs-0001vq-71 for bug-gnu-emacs@gnu.org; Sun, 28 May 2023 15:52: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 1q3MQr-0004Kb-VK for bug-gnu-emacs@gnu.org; Sun, 28 May 2023 15:52:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3MQr-0006T7-Rv for bug-gnu-emacs@gnu.org; Sun, 28 May 2023 15:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=D0=99=D0=BE=D1=80=D0=B4=D0=B0=D0=BD_?= =?UTF-8?Q?=D0=9C=D0=B8=D0=BB=D0=B0=D0=B4=D0=B8=D0=BD=D0=BE=D0=B2?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 May 2023 19:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63708 X-GNU-PR-Package: emacs Original-Received: via spool by 63708-submit@debbugs.gnu.org id=B63708.168530351924855 (code B ref 63708); Sun, 28 May 2023 19:52:01 +0000 Original-Received: (at 63708) by debbugs.gnu.org; 28 May 2023 19:51:59 +0000 Original-Received: from localhost ([127.0.0.1]:54673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3MQo-0006Sp-IJ for submit@debbugs.gnu.org; Sun, 28 May 2023 15:51:58 -0400 Original-Received: from mail-4319.protonmail.ch ([185.70.43.19]:15419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3MQk-0006SZ-Iz for 63708@debbugs.gnu.org; Sun, 28 May 2023 15:51:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=fnsbkx5ebzgxzkvlxko2ys3dhm.protonmail; t=1685303508; x=1685562708; bh=Lt1ukPI0bSgJ/yeWGgp71RQtctCPOFle5oHBn0cq+n0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=SxQk9I/tDIXv2mKh2Fa+Wzs8JNNb8eQdK6GQOcdzUtE5Z6a4kcTUnuHnvbtPFpvq5 xXk262Qf5MNi+ChicV7q4Y/4wWlO5qFWWSnCmk5pAf5scE/IcCAmByAUDWLTX2zQvz gm77HUTAOuGzio8wCkGo6MAatHU89yJLbu7VCJESAqdxT0ojx+kfScXsW47oF60J3W JDv7xqV0p3y7dJ8IZXmBHrkcExLTxgEdEDsfy51Qf97ZXkP1sorTQ4wg0rnDSPHc+b YWlVyvKVooaB7I08D7XIIW/4Uq7ynBUxEQhpXZ3pMgy3HygBxE4In0PFnNgV1+sgoF PA1EyFcQjMY2Q== In-Reply-To: Feedback-ID: 46506384:user:proton 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:262544 Archived-At: Thanks for the comments! Here's the updated review + the same trick applied for Go as well as I disc= overed the same bug in go-ts-mode. > On Saturday, May 27th, 2023 at 6:00 AM, Randy Taylor > wrot= e: > > Do we want to use string-to-syntax here? I believe we do as this is what both the old c-mode and the new c-ts-mode d= efine. If you're going to commit these fixes for both Rust and Go, would you like = me to go through all native treesiter modes, check for the same bug and eve= ntually apply the same fix? Cheers! YM > On Friday, May 26th, 2023 at 15:14, =D0=99=D0=BE=D1=80=D0=B4=D0=B0=D0= =BD =D0=9C=D0=B8=D0=BB=D0=B0=D0=B4=D0=B8=D0=BD=D0=BE=D0=B2 yordanm@proton.m= e wrote: >=20 > > Here's a patch that implements Randy's idea. >=20 >=20 > Thanks for working on this! >=20 > This fix is indeed what I had in mind and I see that you also fixed anoth= er bug, thanks! > Eli, the changes to the existing loop are needed to apply the correct syn= tax properties > to type_parameters, which were previously incorrectly considered punctuat= ion. > I think this is the safest fix for Emacs 29. >=20 > I have some other comments about the patch below. >=20 > + (put-text-property (match-beginning 0) > + (match-end 0) > + 'syntax-table > + '(7)))) > ^^^ >=20 >=20 > - "Apply syntax text property to template delimiters between BEG and END. > + "Apply proper syntax properties to various special characters with > +double meaning in Rust code between BEG and END. >=20 > Maybe "Apply syntax properties to various special characters with context= ual meaning between BEG and END."? >=20 > -< and > are usually punctuation, e.g., as greater/less-than. But >=20 > -when used for types, they should be considered pairs. > +Apostrophe (') is commonly treated as punctuation, but when used > +to define character literals, it should be treated as a string. >=20 > Maybe "Apostrophes (') are commonly treated as punctuation, but when used= to define character literals, they should be treated as strings."?