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: Thu, 7 Sep 2023 15:09:39 +0300 Message-ID: <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> 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="7491"; 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 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= To: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 07 14:10:27 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 1qeDq5-0001it-HV for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Sep 2023 14:10:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeDpi-00019L-SJ; Thu, 07 Sep 2023 08:10:02 -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 1qeDph-00018p-2J for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 08:10:01 -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 1qeDpg-0000O9-QK for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 08:10:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qeDpi-0002KR-5m for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 08:10: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: Thu, 07 Sep 2023 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65470 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65470-submit@debbugs.gnu.org id=B65470.16940885948933 (code B ref 65470); Thu, 07 Sep 2023 12:10:02 +0000 Original-Received: (at 65470) by debbugs.gnu.org; 7 Sep 2023 12:09:54 +0000 Original-Received: from localhost ([127.0.0.1]:38762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeDpa-0002K1-CK for submit@debbugs.gnu.org; Thu, 07 Sep 2023 08:09:54 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:36365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeDpW-0002Jn-Ib for 65470@debbugs.gnu.org; Thu, 07 Sep 2023 08:09:52 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id BF9EA5C0189; Thu, 7 Sep 2023 08:09:43 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 07 Sep 2023 08:09:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :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= 1694088583; x=1694174983; bh=9PA2gtLFo7nALlrsElrJoNDwkUbj3Ltj/iQ mw7MBjS0=; b=TWSFEsQLBPbbiE+FBY/htAKRdOTvIO5ggpx/Tg/MJhtCg4BbHb6 /IHkQEBDX7nCgsBpt63OW2Am7rdPorSymesfuhH1WXRFVInqp/DSk4JTpc0bXGER 415n0eTykhGovpzV0igbPNL0MCyTKpe8EPR5rrxg5bE3aG+T0Gbpsq41v/Fee4IB 77EPdsB7BVA/b/8GiV2Q3YCCOmH9HHWBa+IQ2VtUEGvIJKqWl85PD+9DUAfirk1b OWEGRLbkuyMRmE/XAIKFgYKSREUu7fzQASJtHeP020bnGypjIC0TxMg8Fi6TVAod CmAKRnGtaJAP/8LEzPAkKHry/W+0VsrMJ+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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= 1694088583; x=1694174983; bh=9PA2gtLFo7nALlrsElrJoNDwkUbj3Ltj/iQ mw7MBjS0=; b=QKdCDpSON0UoS6HR6275aoQAkhaivgZ2b2Uo/YmRr20ZZU5Cj3P CzBxz35Amqs4zXXrmd8iukrs5CopBFH2yKX6w7ObuWy1Su+DDHpSaf3MgcD4vFJi 7rU/bNxjuGc+XVVX1Bzy12cgXyZK17ZXCzIs6XSVWYd37YvpgoupWiLxQ1ZVtJ6N Mn32PO5/FP+k8CVnstfGMxwI1bN8WCPcHpTrDkfz5+egDmREHEFXzfrWnnYCMq+I VAi6MBOiPk0/SBJDHzxVyfseq/9jkLgm/7oU81VS0+bDxJbnhCA4y7PXn7JTKowl ZakbKtZNMAfMQpcAuyASsv9jV6ePSbJW3bQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehhedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 7 Sep 2023 08:09:41 -0400 (EDT) Content-Language: en-US In-Reply-To: <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> 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:269643 Archived-At: On 05/09/2023 22:31, Jostein Kjønigsen wrote: > The patch so far is attached. It’s intentionally -not- optimized to leave room for TSX cases which may arise, so hopefully no need to nitpick this yet. I was going to nitpick it, but then read the rest of your message ;-( > However the patch for js-ts-mode has lots of … interesting stuff about jsx I have not included, for no other reason than not understanding what type of use-cases they are meant to support. > > If someone can provide me some examples for the JSX use-cases, I can try to make room for TSX-variants of the same code. The idea was to "enclose" every TSX in "generic string" syntax so that whatever unpaired characters are inside (such as (, ", ...), won't affect syntax-ppss status on the outside. I'm not sure how critical that is, but I guess some users might encounter such situations. Examples like: ReactDOM.render(

Hello, Welcome to React and TypeScript ;-(

, // type closing paren here and see that it's matched to opener above document.getElementById("root") );