GNU bug report logs - #76731
C-style comment regexp example in (info "(elisp)Rx Notation") is not correct

Previous Next

Package: emacs;

Reported by: "Yue Yi" <include_yy <at> qq.com>

Date: Tue, 4 Mar 2025 04:09:02 UTC

Severity: wishlist

Done: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #27 received at 76731 <at> debbugs.gnu.org (full text, mbox):

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Yue Yi <include_yy <at> qq.com>, 76731 <at> debbugs.gnu.org,
 Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#76731: C-style comment regexp example in (info "(elisp)Rx
 Notation") is not correct
Date: Tue, 20 May 2025 13:48:45 +0200
20 maj 2025 kl. 00.42 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:

> Our regexp engine lacks to "switch" kind of operation needed for that.
> After a series of `*` we have two mutually exclusive paths, depending on whether
> the next char is a `/` or something else, but we don't have a "look
> ahead" so we have to push a backtrack-point before we try to match the
> next char with `/`.

All true but we do have the ad-hoc non-backtracking optimisation. Right now it's only used for 'simple' patterns as in

(: (* "a") "b")

but there shouldn't be any reason not to use it for, say,

(: (* "a" ARBITRARY-PATTERN) "b")

should it? Except for ease of implementation, of course.





This bug report was last modified today.

Previous Next


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