From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Wed, 23 Aug 2023 16:23:13 +0300 Message-ID: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36894"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Augustin =?UTF-8?Q?Ch=C3=A9neau?= (BTuin) , 65470@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 23 15:24:15 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 1qYnqI-0009LU-Ai for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Aug 2023 15:24:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYnq5-00060D-0N; Wed, 23 Aug 2023 09:24: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 1qYnq3-0005zq-CX for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 09:23: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 1qYnq3-0006uF-4P for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 09:23:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYnq6-0003Le-32 for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 09:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Aug 2023 13:24: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.169279701212833 (code B ref 65470); Wed, 23 Aug 2023 13:24:02 +0000 Original-Received: (at 65470) by debbugs.gnu.org; 23 Aug 2023 13:23:32 +0000 Original-Received: from localhost ([127.0.0.1]:33160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYnpc-0003Kv-72 for submit@debbugs.gnu.org; Wed, 23 Aug 2023 09:23:32 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:50919) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYnpX-0003Ke-Bv for 65470@debbugs.gnu.org; Wed, 23 Aug 2023 09:23:30 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8EE1B320090B; Wed, 23 Aug 2023 09:23:17 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 23 Aug 2023 09:23:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1692796997; x=1692883397; bh=CunCNFwEt5zjFtQ0zEntLfQms3/PI8Q5zQ0 KYK/5G+s=; b=qBbRwtVWaU5PxeU/lkYchmbrptPdpGMwtSfon/GbK3XGhcb01cu Tzx5nkbiszfOMQTgSKL29GkzXRf/oXRFi8y6bq+rjt//7gp+SktWBP0RzvsWIie1 Z60IbedL4x/Y5F5WvfHEZCTzuTBtvwYbYhLaIGE7TbCVnKeTd6QEaG54GU8thuNC 2WqLkOY7sS8hzo8PaiVbdXuY4NZeOm9DGi/KZDlNfpZj3oTZB951NRQWQnAb2Nrk z1nGNpTym4vkcPJxOEZfHNkCisnGJifwR8OtpBRHFemZFPoNDtuAz5cKfmGgNOUn cVxbJLwpJXHm44awOBQOLk8o3tSFslaLwVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1692796997; x= 1692883397; bh=CunCNFwEt5zjFtQ0zEntLfQms3/PI8Q5zQ0KYK/5G+s=; b=f WvZ0A713ar4JLqsWFgIOOSjf3mPym/22qLzlvMWbv48YS+qp01+2fz4utneAlTVM 3aQH0V1e0qOwFCwSKOZcvco1FG2LPDPJFrPrSznxmqjTDs+C/ixAjCNWoGIgBfA+ ufanTAEpj4AeyhWbh6qPNZIy9qHmPn6XMf5f1RRVZPh4hNH9GZtQJccH8S4Htljw 7LUecelyxD3RTohOweM5TNYym5NgsWLxkwOhQtAmzfS7a64SoFbXVmO1sycuERcL /nXzTM421BPWPzZz7EL4Y/bv2g3A8NKAk0pBoOaeHtY8/Rhrd6SKnA2oKaOWCzg0 bKdGNfuzS8Lmvl3UHo+fA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddvgedgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeefjeekvedvfeelfedufeevgeetvdevkeelvddtueetteefudefgfduieekffei leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 23 Aug 2023 09:23:15 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:268241 Archived-At: 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.