grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.25-87-g1e266d3


From: Paul Eggert
Subject: grep branch, master, updated. v2.25-87-g1e266d3
Date: Thu, 8 Sep 2016 16:44:50 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  1e266d3e1cf1326e5800a7c1b0b9e54bbe492c07 (commit)
      from  455c840f4790840a77f10f2e309e8e0481f5190a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=1e266d3e1cf1326e5800a7c1b0b9e54bbe492c07


commit 1e266d3e1cf1326e5800a7c1b0b9e54bbe492c07
Author: Norihiro Tanaka <address@hidden>
Date:   Fri Sep 9 01:34:47 2016 +0900

    dfa: additional change new option for anchored searches
    
    * src/dfa.c (dfaexec_main): Do it.

diff --git a/src/dfa.c b/src/dfa.c
index 5c045ac..4c41fa6 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -1461,7 +1461,7 @@ lex (struct dfa *dfa)
             {
               zeroset (ccl);
               for (c2 = 0; c2 < NOTCHAR; ++c2)
-                if (unibyte_word_constituent (dfa, c2))
+                if (dfa->syntax.sbit[c2] == CTX_LETTER)
                   setbit (c2, ccl);
               if (c == 'W')
                 notset (ccl);
@@ -2178,11 +2178,10 @@ charclass_context (struct dfa const *dfa, charclass c)
   int context = 0;
   unsigned int j;
 
-  if (tstbit (dfa->syntax.eolbyte, c))
-    context |= CTX_NEWLINE;
-
   for (j = 0; j < CHARCLASS_WORDS; ++j)
     {
+      if (c[j] & dfa->syntax.newline[j])
+        context |= CTX_NEWLINE;
       if (c[j] & dfa->syntax.letters[j])
         context |= CTX_LETTER;
       if (c[j] & ~(dfa->syntax.letters[j] | dfa->syntax.newline[j]))
@@ -2676,13 +2675,27 @@ dfastate (state_num s, struct dfa *d, state_num trans[])
      is to fail miserably.  */
   if (d->searchflag)
     {
+      int c;
+
       state_newline = 0;
       state_letter = d->min_trcount - 1;
       state = d->initstate_notbol;
 
-      for (i = 0; i < NOTCHAR; ++i)
-        trans[i] = unibyte_word_constituent (d, i) ? state_letter : state;
-      trans[d->syntax.eolbyte] = state_newline;
+      for (c = 0; c < NOTCHAR; ++c)
+        {
+          switch (d->syntax.sbit[c])
+            {
+            case CTX_NEWLINE:
+              trans[c] = state_newline;
+              break;
+            case CTX_LETTER:
+              trans[c] = state_letter;
+              break;
+            default:
+              trans[c] = state;
+              break;
+            }
+        }
     }
   else
     for (i = 0; i < NOTCHAR; ++i)
@@ -2785,12 +2798,18 @@ dfastate (state_num s, struct dfa *d, state_num trans[])
             {
               int c = j * CHARCLASS_WORD_BITS + k;
 
-              if (c == d->syntax.eolbyte)
-                trans[c] = state_newline;
-              else if (unibyte_word_constituent (d, c))
-                trans[c] = state_letter;
-              else if (c < NOTCHAR)
-                trans[c] = state;
+              switch (d->syntax.sbit[c])
+                {
+                case CTX_NEWLINE:
+                  trans[c] = state_newline;
+                  break;
+                case CTX_LETTER:
+                  trans[c] = state_letter;
+                  break;
+                default:
+                  trans[c] = state;
+                  break;
+                }
             }
     }
 

-----------------------------------------------------------------------

Summary of changes:
 src/dfa.c |   45 ++++++++++++++++++++++++++++++++-------------
 1 file changed, 32 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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