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 #24 received at 76731-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
Cc: 76731-done <at> debbugs.gnu.org, Yue Yi <include_yy <at> qq.com>,
 Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#76731: C-style comment regexp example in (info "(elisp)Rx
 Notation") is not correct
Date: Mon, 19 May 2025 18:42:42 -0400
> I see no fundamental reason why they should be, as the C comment syntax can
> be parsed efficiently by a tiny state machine.

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


        Stefan





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.