From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 07 06:00:57 2016 Received: (at submit) by debbugs.gnu.org; 7 Jul 2016 10:00:57 +0000 Received: from localhost ([127.0.0.1]:40220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL675-0004jN-Bm for submit@debbugs.gnu.org; Thu, 07 Jul 2016 06:00:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL672-0004jA-RM for submit@debbugs.gnu.org; Thu, 07 Jul 2016 06:00:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bL66w-0002D7-57 for submit@debbugs.gnu.org; Thu, 07 Jul 2016 06:00:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL66v-0002BM-IW for submit@debbugs.gnu.org; Thu, 07 Jul 2016 06:00:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL66s-0000bC-N2 for bug-grep@gnu.org; Thu, 07 Jul 2016 06:00:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bL66m-000278-D0 for bug-grep@gnu.org; Thu, 07 Jul 2016 06:00:41 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:56629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL66l-00026x-Vm for bug-grep@gnu.org; Thu, 07 Jul 2016 06:00:36 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C3D27161516 for ; Thu, 7 Jul 2016 03:00:34 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id wc5q9TRGIgkH; Thu, 7 Jul 2016 03:00:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E6859161515; Thu, 7 Jul 2016 03:00:33 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5BAYnB_AuMaE; Thu, 7 Jul 2016 03:00:33 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C5380161513; Thu, 7 Jul 2016 03:00:33 -0700 (PDT) From: Paul Eggert To: bug-grep@gnu.org Subject: [INSTALLED PATCH] dfa: fix comments to match code better Date: Thu, 7 Jul 2016 12:00:21 +0200 Message-Id: <1467885621-11442-1-git-send-email-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.5.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) * src/dfa.c: Fix comments. --- src/dfa.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/dfa.c b/src/dfa.c index 8f9f0bc..f7e907b 100644 --- a/src/dfa.c +++ b/src/dfa.c @@ -3034,28 +3034,29 @@ skip_remains_mb (struct dfa *d, unsigned char const *p, return mbp; } -/* Search through a buffer looking for a match to the given struct dfa. +/* Search through a buffer looking for a match to the struct dfa *D. Find the first occurrence of a string matching the regexp in the buffer, and the shortest possible version thereof. Return a pointer to the first character after the match, or NULL if none is found. BEGIN points to the beginning of the buffer, and END points to the first byte after its end. Note however that we store a sentinel byte (usually newline) in *END, so the actual buffer must be one byte longer. - When ALLOW_NL is nonzero, newlines may appear in the matching string. + When ALLOW_NL, newlines may appear in the matching string. If COUNT is non-NULL, increment *COUNT once for each newline processed. - Finally, if BACKREF is non-NULL set *BACKREF to indicate whether we - encountered a DFA-unfriendly construct. The caller may use this to - decide whether to fall back on a matcher like regex. If MULTIBYTE, - the input consists of multibyte characters and/or encoding-error bytes. - Otherwise, the input consists of single-byte characters. + If MULTIBYTE, the input consists of multibyte characters and/or + encoding-error bytes. Otherwise, it consists of single-byte characters. Here is the list of features that make this DFA matcher punt: - - [M-N]-range-in-MB-locale: regex is up to 25% faster on [a-z] + - [M-N] range in non-simple locale: regex is up to 25% faster on [a-z] + - [^...] in non-simple locale + - [[=foo=]] or [[.foo.]] + - [[:alpha:]] etc. in multibyte locale (except [[:digit:]] works OK) - back-reference: (.)\1 - - word-delimiter-in-MB-locale: \<, \>, \b - */ + - word-delimiter in multibyte locale: \<, \>, \b, \B + See using_simple_locale for the definition of "simple locale". */ + static inline char * dfaexec_main (struct dfa *d, char const *begin, char *end, bool allow_nl, - size_t *count, bool multibyte) + size_t *count, bool multibyte) { state_num s, s1; /* Current state. */ unsigned char const *p, *mbp; /* Current input character. */ @@ -3224,8 +3225,8 @@ dfaexec_main (struct dfa *d, char const *begin, char *end, bool allow_nl, return (char *) p; } -/* Specialized versions of dfaexec_main for multibyte and single-byte - cases. This is for performance. */ +/* Specialized versions of dfaexec for multibyte and single-byte cases. + This is for performance, as dfaexec_main is an inline function. */ static char * dfaexec_mb (struct dfa *d, char const *begin, char *end, @@ -3251,8 +3252,9 @@ dfaexec_noop (struct dfa *d, char const *begin, char *end, return (char *) begin; } -/* Like dfaexec_main (D, BEGIN, END, ALLOW_NL, COUNT, BACKREF, D->multibyte), - but faster. */ +/* Like dfaexec_main (D, BEGIN, END, ALLOW_NL, COUNT, D->multibyte), + but faster and set *BACKREF if the DFA code does not support this + regexp usage. */ char * dfaexec (struct dfa *d, char const *begin, char *end, -- 2.5.5 From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 07 06:01:57 2016 Received: (at control) by debbugs.gnu.org; 7 Jul 2016 10:01:57 +0000 Received: from localhost ([127.0.0.1]:40232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL684-0004lw-TF for submit@debbugs.gnu.org; Thu, 07 Jul 2016 06:01:57 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:48054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL683-0004le-5r for control@debbugs.gnu.org; Thu, 07 Jul 2016 06:01:55 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 79871161513 for ; Thu, 7 Jul 2016 03:01:49 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id uGFsxcDVRyH7 for ; Thu, 7 Jul 2016 03:01:48 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A4F95161515 for ; Thu, 7 Jul 2016 03:01:48 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id UUGC04VNrVM2 for ; Thu, 7 Jul 2016 03:01:48 -0700 (PDT) Received: from [192.168.0.35] (89-159-79-138.rev.numericable.fr [89.159.79.138]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id CFD4C161513 for ; Thu, 7 Jul 2016 03:01:47 -0700 (PDT) To: control@debbugs.gnu.org From: Paul Eggert Subject: close 23908 Message-ID: <577E2888.9060601@cs.ucla.edu> Date: Thu, 7 Jul 2016 12:01:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) close 23908 From unknown Thu Jun 19 16:22:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 04 Aug 2016 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator