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#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Thu, 24 Aug 2023 08:59:17 +0300 Message-ID: <83fs49q8ui.fsf@gnu.org> References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38081"; mail-complaints-to="usenet@ciao.gmane.io" Cc: btuin@mailo.com, 65470@debbugs.gnu.org To: Dmitry Gutov , Theodor Thornhill , Jostein Kjonigsen , Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 24 08:00:18 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 1qZ3OE-0009ld-OK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 08:00:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ3Nx-0003fW-H1; Thu, 24 Aug 2023 02:00: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 1qZ3Nw-0003fH-4K for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 02:00:00 -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 1qZ3Nv-0001uU-SW for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 01:59:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZ3Nz-0007de-0R for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 02:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Aug 2023 06:00: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.169285674929264 (code B ref 65470); Thu, 24 Aug 2023 06:00:02 +0000 Original-Received: (at 65470) by debbugs.gnu.org; 24 Aug 2023 05:59:09 +0000 Original-Received: from localhost ([127.0.0.1]:35938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ3N6-0007bw-Nz for submit@debbugs.gnu.org; Thu, 24 Aug 2023 01:59:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ3N4-0007bQ-6w for 65470@debbugs.gnu.org; Thu, 24 Aug 2023 01:59:07 -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 1qZ3Mt-0001r0-AI; Thu, 24 Aug 2023 01:58:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=LDy0MiKgJzQP2NJ30060IGKYryoSAj3rS4FYykxSIMk=; b=Sik+H8Jg8ZKmnJShUEpP AEqNaD3R5xW1CA9kzbtQsmEE6cvs0UlEkOuGCAiZWt222zps3H7H/cewklnem70l3t7/GpGjZq1eQ CM/Aqjph01RUsBO9YU3VxEjx2wddKSCx9IballKkrLgSOQTP2gDuEMXBYq3qz30GFRMVz2fzlTEu2 28piszbqHX/QjT7XJhiyfvfCKg8u2igBVt6RfOoN5JEZByc81BdM4A1F4DsCeL/DNTjnAicKC1obk M9MFiC9spoLNTT/7kj+p0I5kZihU63cNUABkcTz4QCCsvKw6aH0lTr6WgaHQ8EUlsQAPaYR0+rfWd Ae/6wRowyvHjQg==; In-Reply-To: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> (message from Dmitry Gutov on Wed, 23 Aug 2023 16:23:13 +0300) 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:268303 Archived-At: > Date: Wed, 23 Aug 2023 16:23:13 +0300 > From: Dmitry Gutov > > On 23/08/2023 12:05, Augustin Chéneau (BTuin) wrote: > > > > 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: > > > > (/foobar)/) > > > > 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. > > > > 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 first > > parenthesis should match with the third one. Here, the first parenthesis > > is matched with the last one: > > > > ("foobar)") > > > > js-mode behaves correctly in both cases. > > Sounds like js-ts-mode also needs a syntax-propertize-function, similar > to c-ts-mode, ruby-ts-mode and rust-ts-mode. > > Others (typescript-ts-mode?) probably need it as well, at least modes > 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