emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs regexp scan (Sep 29)


From: Mattias Engdegård
Subject: Re: Emacs regexp scan (Sep 29)
Date: Sat, 5 Oct 2019 11:37:45 +0200

5 okt. 2019 kl. 10.10 skrev Eli Zaretskii <address@hidden>:

> If the regexp scanner needs to be pacified, isn't it better to fix the
> scanner instead?

The check is there because it is often useful. Relint/xr has been detecting and 
complaining about non-escaped use of special characters such as +, *, ?, ^ and 
$ for some time now, and for good reason: it's an error-prone exploitation of a 
hole in the syntax. We think that "*.^" is better written "\\*.\\^" because the 
latter is more regular, less likely to break when modified, and tells the 
reader that no, it isn't a mistake, the programmer knows what he is doing.

Such non-essential escaping has been added many times before, and it has never 
been controversial in the slightest.

> I also don't think I see the simplification here.  In fact, the
> original code looks simpler to me than the new one, as the former is
> just a simple while loop, whereas the latter is a nested dolist.

Actually the original was a nested pair of while loops, which indicates that it 
wasn't quite that simple.




reply via email to

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