bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64019: 29.0.91; Fix some tree-sitter :match regexps


From: Basil Contovounesios
Subject: bug#64019: 29.0.91; Fix some tree-sitter :match regexps
Date: Tue, 13 Jun 2023 15:08:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Dmitry Gutov [2023-06-13 00:33 +0300] wrote:

> On 12/06/2023 17:25, Basil L. Contovounesios via Bug reports for GNU Emacs, 
> the
> Swiss army knife of text editors wrote:
>> -      (:match "^DEFUN$" @fn))
>> +      (:match "\\`DEFUN\\'" @fn))
>
> FWIW, most of these changes are superfluous, practically speaking

I'm less concerned about the trivial bol/bos conversions in the patch
and more about the corrections to incorrect regexps, such as:
- the more benign \(:?...\) -> \(?:...\)
- and the less benign [\d] -> [0-9].

> because node text for these node types (like 'identifier', in this
> example) cannot include newlines.
>
> So we mostly gain some theoretical increase in strictness, 

We also gain the fact that the next one looking at these regexps doesn't
need to figure out whether newlines can appear in this context: the
regexp immediately says it's intended to match the whole given text
rather than a line of text.

> at the expense of a few extra chars in the code.

That's not really an expense, but a symptom of our regexp syntax, so it
can't be helped.

> So I think we could wait until 29.1's release, for example, and then apply 
> this
> on master.

Those parts that will end up applied on master don't need to wait for
29.1, do they?  If so, why?

Here's the updated patch against emacs-29:

Attachment: 0001-Fix-some-tree-sitter-match-regexps.patch
Description: Text Data

WDYT?

Thanks,

-- 
Basil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]