From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Thu, 24 Aug 2023 21:47:09 +0200 Message-ID: <87bkew6x4y.fsf@thornhill.no> References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> Reply-To: Theodor Thornhill 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="29933"; mail-complaints-to="usenet@ciao.gmane.io" Cc: btuin@mailo.com, 65470@debbugs.gnu.org To: Eli Zaretskii , Dmitry Gutov , Jostein Kjonigsen , Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 24 21:48:14 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 1qZGJR-0007YE-PM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 21:48:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZGJF-0002hy-3l; Thu, 24 Aug 2023 15:48:01 -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 1qZGJC-0002hq-PR for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 15:47:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZGJC-0004Uz-Gz for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 15:47:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZGJG-0008GM-BV for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 15:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Aug 2023 19:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65470 X-GNU-PR-Package: emacs Original-Received: via spool by 65470-submit@debbugs.gnu.org id=B65470.169290644131559 (code B ref 65470); Thu, 24 Aug 2023 19:48:02 +0000 Original-Received: (at 65470) by debbugs.gnu.org; 24 Aug 2023 19:47:21 +0000 Original-Received: from localhost ([127.0.0.1]:38662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZGIa-0008Cw-Rl for submit@debbugs.gnu.org; Thu, 24 Aug 2023 15:47:21 -0400 Original-Received: from out-46.mta0.migadu.com ([2001:41d0:1004:224b::2e]:37497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZGIY-0008Cm-6q for 65470@debbugs.gnu.org; Thu, 24 Aug 2023 15:47:19 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1692906432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=abCURdZwye7kmxZMyBPg8VV6Ja8lA/wsguLCnFEpqUA=; b=1TV9re6C3NhQtc2HrSqAufbKbvDDyKOEvyX3Ij52m5eAglNF0z5dt2TUTn5p5dRZ/HVE9o XBHX2vCnWkmuyQt7ngzR7bnIbAeiJtHmv8mTNPfLqpDiZm7gBio1xs+CzDc7eLeJcYghZ+ 44WdmkUqYOkun1Xdv4bvl0BWgZSs9AplI7Wzler+8seS6KHp4/AVzobqrOicAfLDO99Ixz vpRNuTSrRQp6fFbqL8WNVxj1Q5ekygRbWS4MZ1AtsZ4qdbpJhgihHrzKVLfSWct6FBwf+7 0m3fufmpeVB2PLStVAab4QTr+Tv4miO7/1TH9pQSZWesPf0Yk/g+eenwyU+3Vg== In-Reply-To: <83fs49q8ui.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT 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:268354 Archived-At: Eli Zaretskii writes: >> Date: Wed, 23 Aug 2023 16:23:13 +0300 >> From: Dmitry Gutov >>=20 >> On 23/08/2023 12:05, Augustin Ch=C3=A9neau (BTuin) wrote: >> >=20 >> > With the mode js-ts-mode, matching tokens (such as '()', '[]') can be >> > incorrectly paired by `show-paren-mode`. This is trivially reproducible >> > with this simple example: >> >=20 >> > (/foobar)/) >> >=20 >> > The first parenthesis is matched with the second one, which is inside a >> > regular expression pattern (between slashes), and the last one is not >> > paired. >> >=20 >> > The behavior should be the same as for string, the content of the regex >> > pattern should have no influence on the structure of the code. The fir= st >> > parenthesis should match with the third one. Here, the first parenthes= is >> > is matched with the last one: >> >=20 >> > ("foobar)") >> >=20 >> > js-mode behaves correctly in both cases. >>=20 >> Sounds like js-ts-mode also needs a syntax-propertize-function, similar= =20 >> to c-ts-mode, ruby-ts-mode and rust-ts-mode. >>=20 >> Others (typescript-ts-mode?) probably need it as well, at least modes=20 >> for those languages that have dedicated regexp or heredoc syntax. > > Would someone please add syntax-propertize-function in modes that need > it? I think this should be done on the emacs-29 branch. > > TIA I'll add it to my list, but if someone will grab it that's fine, as I'm a little short on time the next couple of weeks :-( Theo