GNU bug report logs - #65470
29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching

Previous Next

Package: emacs;

Reported by: Augustin Chéneau (BTuin) <btuin <at> mailo.com>

Date: Wed, 23 Aug 2023 11:16:01 UTC

Severity: normal

Tags: patch

Found in version 29.1.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Yuan Fu <casouri <at> gmail.com>, 65470 <at> debbugs.gnu.org, Theodor Thornhill <theo <at> thornhill.no>, btuin <at> mailo.com, Eli Zaretskii <eliz <at> gnu.org>, Jostein Kjønigsen <jostein <at> kjonigsen.net>
Subject: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching
Date: Tue, 5 Sep 2023 21:31:25 +0200
[Message part 1 (text/plain, inline)]

> On 1 Sep 2023, at 03:42, Dmitry Gutov <dmitry <at> gutov.dev> wrote:
> 
> On 31/08/2023 15:53, Eli Zaretskii wrote:
>>> Date: Thu, 31 Aug 2023 14:15:22 +0300
>>> Cc:jostein <at> secure.kjonigsen.net,casouri <at> gmail.com,theo <at> thornhill.no,
>>>  jostein <at> kjonigsen.net,btuin <at> mailo.com,65470 <at> debbugs.gnu.org
>>> From: Dmitry Gutov<dmitry <at> gutov.dev>
>>> 
>>> On 31/08/2023 12:41, Eli Zaretskii wrote:
>>>> I'm a bit confused by this discussion.  Should I install the patch on
>>>> the emacs-29 branch now, or are you still discussing whether it's
>>>> correct?
>>> I think we were discussing the typescript modes here.
>>> 
>>> Personally I was waiting for some additional confirmation that my v2 for
>>> js-ts-mode is correct, but I guess we have a silent approval, so we can
>>> install it.
>> Good to hear.  Then please install it, and thanks.
> 
> All right, installed one for js-ts-mode.

Sorry for the somewhat slow response on this. Life has been busy for me as well :)

Based on the infamous “copy, paste & adapt” methodology I’ve come up with a patch for typescript-ts-mode and tsx-ts-mode which seems to work for the simple test case provided above.

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 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.

[0001-typescript-ts-mode-Fix-syntax-properties-for-regexp-.patch (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]

—
Jostein

This bug report was last modified 1 year and 249 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.