From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Scan of regexps in emacs Date: Sat, 9 Mar 2019 14:56:21 +0000 Message-ID: <20190309145621.GA5380@ACM> References: <9f6f677b29f514c5f0bb1bb805e89d62eb146999.camel@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="255674"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 09 15:58:44 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h2dQy-0014QA-1d for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2019 15:58:44 +0100 Original-Received: from localhost ([127.0.0.1]:60020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2dQx-00045U-1R for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2019 09:58:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2dQ2-0003Tt-N4 for emacs-devel@gnu.org; Sat, 09 Mar 2019 09:57:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2dQ2-0008PC-25 for emacs-devel@gnu.org; Sat, 09 Mar 2019 09:57:46 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:57070 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1h2dQ1-0008N7-NO for emacs-devel@gnu.org; Sat, 09 Mar 2019 09:57:46 -0500 Original-Received: (qmail 13553 invoked by uid 3782); 9 Mar 2019 14:57:40 -0000 Original-Received: from acm.muc.de (p2E5D5F0A.dip0.t-ipconnect.de [46.93.95.10]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 09 Mar 2019 15:57:39 +0100 Original-Received: (qmail 5403 invoked by uid 1000); 9 Mar 2019 14:56:21 -0000 Content-Disposition: inline In-Reply-To: <9f6f677b29f514c5f0bb1bb805e89d62eb146999.camel@acm.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233970 Archived-At: Hello, Mattias. On Sat, Mar 09, 2019 at 14:26:38 +0100, Mattias Engdegård wrote: > Here is a new regexp error scan of the Emacs source tree. > The new complaints are due to improvements in the regexp-finding > abilities of the trawler. The locations are also more precise, and > there is a caret line for extra help. [ .... ] As a matter of interest, the current scan failed to catch an unescaped ]. This was at the second ^ (inserted by me) in the last quoted line: > emacs/lisp/progmodes/cc-awk.el:191:3: In c-awk-regexp-char-list-re: Unescaped literal `^' (pos 13) > "\\[\\(\\\\[\n\r]\\)*^?\\(\\\\[\n\r]\\)*]?\\(\\\\\\(.\\|\n\\|\r\\|\\'\\)\\|\\[:[a-z]+:\\]\\|[^]\n\r]\\)*\\(]\\|$\\)" > ....................^ ^ Incidentally, there is another error in this regexp. It contains a stanza of the form A*x?A* near the beginning, which is asking for trouble (time exponential in the number of escaped NLs) should there be lots of escaped NLs anywhere. A correct way to write this is \\(A*x\\)?A*. I will be fixing all these glitches. -- Alan Mackenzie (Nuremberg, Germany).