From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augustin =?UTF-8?Q?Ch=C3=A9neau?= (BTuin) 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:31:33 +0200 Message-ID: <2fbfdbf3-6062-49c3-bc48-eb5ab4817ab2@mailo.com> References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------dA0Lg4D6NBzlL7A29INwz6k0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34323"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 65470@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 25 07:16:47 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 1qZPBf-0008lJ-Fr for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Aug 2023 07:16:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZPAx-0004Vg-MS; Fri, 25 Aug 2023 01:16:03 -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 1qZPAu-0004T8-MH for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 01:16: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 1qZPAu-00063U-Aw for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 01:16:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZPAy-0001OB-EZ for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 01:16:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Augustin =?UTF-8?Q?Ch=C3=A9neau?= (BTuin) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2023 05:16:04 +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.16929405275233 (code B ref 65470); Fri, 25 Aug 2023 05:16:04 +0000 Original-Received: (at 65470) by debbugs.gnu.org; 25 Aug 2023 05:15:27 +0000 Original-Received: from localhost ([127.0.0.1]:38952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZPAM-0001MJ-Gr for submit@debbugs.gnu.org; Fri, 25 Aug 2023 01:15:27 -0400 Original-Received: from msg-4.mailo.com ([213.182.54.15]:34064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZG3U-0007pi-UQ for 65470@debbugs.gnu.org; Thu, 24 Aug 2023 15:31:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1692905494; bh=NzSy0kcnLVQIuje99qBBpJ3yQ0ihLpK6fWQEXkD/XII=; h=X-EA-Auth:Content-Type:Message-ID:Date:MIME-Version:Subject:To: References:From:In-Reply-To; b=cRVSz9Pl3Wxt+CKN7DJEYvhCGeNGp9h5o5vxIdk5qpfuDbRAm2I279idC1RLEExXB GCs6RH2iicm2mqFjkEEOj1NYXjDy8swK7oy3zC0gPoY6KzKkVbV8eSqeuEme1HSOvP lTP7pnEHuegfbiANAT/9+160F5CouQps9Q8iQBgw= Original-Received: by b221-5.in.mailobj.net [192.168.90.25] with ESMTP via ip-20.mailobj.net [213.182.54.20] Thu, 24 Aug 2023 21:31:34 +0200 (CEST) X-EA-Auth: k3jzLpl19CyczaY0/BlyogPP4ushjeiKqlp8F+Fa7p6PMhETt+gYj8XAUWUc+xyRYV2+Yd/F7XyrnbODZqIaos4rbOo8stE2 Content-Language: fr, en-US In-Reply-To: <83fs49q8ui.fsf@gnu.org> X-Mailman-Approved-At: Fri, 25 Aug 2023 01:15:25 -0400 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:268385 Archived-At: This is a multi-part message in MIME format. --------------dA0Lg4D6NBzlL7A29INwz6k0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I have created a patch heavily inspired from ruby-ts-mode. It fixes the trivial examples and it works as expected in a more complex file. I'm not sure if the commit message is formatted properly. --------------dA0Lg4D6NBzlL7A29INwz6k0 Content-Type: text/x-patch; charset=UTF-8; name="0001-Apply-syntax-properties-to-regex-delimiters-in-js-ts.patch" Content-Disposition: attachment; filename*0="0001-Apply-syntax-properties-to-regex-delimiters-in-js-ts.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBkN2JiN2E3N2E1NzAyNmYzODVjNDEzN2EyNTE5OWViMmEyYzE1NzY4IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBBdWd1c3RpbiBDaMO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gICAgICAgICAgICAgICAgICAgICAnKCgocmVnZXgg Ii8iIEByZWdleF9zbGFzaCkpKSkpKQorCisoZGVmdW4ganMtdHMtbW9kZS0tc3ludGF4LXBy b3BlcnRpemUgKGJlZyBlbmQpCisgICJBcHBseSBzeW50YXggcHJvcGVydGllcyB0byBzcGVj aWFsIGNoYXJhY3RlcnMgYmV0d2VlbiBCRUcgYW5kIEVORC4KKworQXBwbHkgc3ludGF4IHBy b3BlcnRpZXMgdG8gcmVnZXggZGVsaW1pdGVycyAoc2xhc2hlcykuIgorICAobGV0ICgoY2Fw dHVyZXMgKHRyZWVzaXQtcXVlcnktY2FwdHVyZSAnamF2YXNjcmlwdCBqcy10cy0tcmVnZXgt cXVlcnkgYmVnIGVuZCkpKQorICAgIChwY2FzZS1kb2xpc3QgKGAoLG5hbWUgLiAsbm9kZSkg Y2FwdHVyZXMpCisgICAgICAocGNhc2UtZXhoYXVzdGl2ZSBuYW1lCisJKCdyZWdleF9zbGFz aAorCSAocHV0LXRleHQtcHJvcGVydHkgKHRyZWVzaXQtbm9kZS1zdGFydCBub2RlKSAoMSsg KHRyZWVzaXQtbm9kZS1zdGFydCBub2RlKSkKKwkJCSAgICAnc3ludGF4LXRhYmxlCisJCQkg ICAgKHN0cmluZy10by1zeW50YXggIlwiLyIpKSkpKSkpCisKIDs7OyBNYWluIEZ1bmN0aW9u CiAKIDs7OyMjI2F1dG9sb2FkCkBAIC0zODUwLDYgKzM4NjcsOSBAQCBqcy10cy1tb2RlCiAg ICAgICAgICAgICAgICAgICAoIGFzc2lnbm1lbnQgY29uc3RhbnQgZXNjYXBlLXNlcXVlbmNl IGpzeCBudW1iZXIKICAgICAgICAgICAgICAgICAgICAgcGF0dGVybiBzdHJpbmctaW50ZXJw b2xhdGlvbikKICAgICAgICAgICAgICAgICAgICggYnJhY2tldCBkZWxpbWl0ZXIgZnVuY3Rp b24gb3BlcmF0b3IgcHJvcGVydHkpKSkKKyAgICA7OyBTeW50YXggdGFibGUKKyAgICAoc2V0 cS1sb2NhbCBzeW50YXgtcHJvcGVydGl6ZS1mdW5jdGlvbgorICAgICAgICAgICAgICAgICMn anMtdHMtbW9kZS0tc3ludGF4LXByb3BlcnRpemUpCiAgICAgOzsgSW1lbnUKICAgICAoc2V0 cS1sb2NhbCB0cmVlc2l0LXNpbXBsZS1pbWVudS1zZXR0aW5ncwogICAgICAgICAgICAgICAg IGAoKCJGdW5jdGlvbiIgIlxcYGZ1bmN0aW9uX2RlY2xhcmF0aW9uXFwnIiBuaWwgbmlsKQot LSAKMi40Mi4wCgo= --------------dA0Lg4D6NBzlL7A29INwz6k0--