grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.6.3-50-g0f4afc6


From: Paolo Bonzini
Subject: grep branch, master, updated. v2.6.3-50-g0f4afc6
Date: Mon, 19 Apr 2010 08:02:55 +0000

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  0f4afc66be2e4c48d1f7b6b2c02122fbe5222921 (commit)
       via  2b2b4e96fdfacf184c32f97ba2050b1318740420 (commit)
       via  1e2a331e159b2313126ee99c768649dc07d81692 (commit)
      from  2f4c8f30865e6a52db8e15fdccf05a0595f1373d (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=0f4afc66be2e4c48d1f7b6b2c02122fbe5222921


commit 0f4afc66be2e4c48d1f7b6b2c02122fbe5222921
Author: Paolo Bonzini <address@hidden>
Date:   Sat Apr 17 04:02:31 2010 +0200

    dfa: drop ORTOP
    
    * src/dfa.c (token, prtok, addtok_mb, nsubtoks, dfaanalyze, dfamust):
    Remove ORTOP.
    (regexp): Remove parameter, always add OR at the end, adjust callers.
    (atom): Adjust caller.
    (dfaparse): Adjust caller.  Always add OR at the end.

diff --git a/src/dfa.c b/src/dfa.c
index 9b67240..fe093a8 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -207,9 +207,6 @@ typedef enum
   OR,                          /* OR is an operator of two arguments that
                                    matches either of its arguments. */
 
-  ORTOP,                       /* OR at the toplevel in the parse tree.
-                                   This is used for a boyer-moore heuristic. */
-
   LPAREN,                      /* LPAREN never appears in the parse tree,
                                    it is only a lexeme. */
 
@@ -401,7 +398,7 @@ struct dfa
                        prevn, currn, prevl, currl)
 
 static void dfamust (struct dfa *dfa);
-static void regexp (int toplevel);
+static void regexp (void);
 
 #define CALLOC(p, t, n) ((p) = xcalloc((size_t)(n), sizeof (t)))
 #define MALLOC(p, t, n) ((p) = xmalloc((n) * sizeof (t)))
@@ -446,7 +443,6 @@ prtok (token t)
         case PLUS: s = "PLUS"; break;
         case CAT: s = "CAT"; break;
         case OR: s = "OR"; break;
-        case ORTOP: s = "ORTOP"; break;
         case LPAREN: s = "LPAREN"; break;
         case RPAREN: s = "RPAREN"; break;
 #if MBS_SUPPORT
@@ -1417,7 +1413,6 @@ addtok_mb (token t, int mbprop)
 
     case CAT:
     case OR:
-    case ORTOP:
       --depth;
       break;
 
@@ -1543,7 +1538,7 @@ atom (void)
   else if (tok == LPAREN)
     {
       tok = lex();
-      regexp(0);
+      regexp();
       if (tok != RPAREN)
         dfaerror(_("unbalanced ("));
       tok = lex();
@@ -1568,7 +1563,6 @@ nsubtoks (int tindex)
       return 1 + nsubtoks(tindex - 1);
     case CAT:
     case OR:
-    case ORTOP:
       ntoks1 = nsubtoks(tindex - 1);
       return 1 + ntoks1 + nsubtoks(tindex - 1 - ntoks1);
     }
@@ -1644,17 +1638,14 @@ branch (void)
 }
 
 static void
-regexp (int toplevel)
+regexp (void)
 {
   branch();
   while (tok == OR)
     {
       tok = lex();
       branch();
-      if (toplevel)
-        addtok(ORTOP);
-      else
-        addtok(OR);
+      addtok(OR);
     }
 }
 
@@ -1687,7 +1678,7 @@ dfaparse (char const *s, size_t len, struct dfa *d)
   tok = lex();
   depth = d->depth;
 
-  regexp(1);
+  regexp();
 
   if (tok != END)
     dfaerror(_("unbalanced )"));
@@ -1696,7 +1687,7 @@ dfaparse (char const *s, size_t len, struct dfa *d)
   addtok(CAT);
 
   if (d->nregexps)
-    addtok(ORTOP);
+    addtok(OR);
 
   ++d->nregexps;
 }
@@ -2092,7 +2083,6 @@ dfaanalyze (struct dfa *d, int searchflag)
         break;
 
       case OR:
-      case ORTOP:
         /* The firstpos is the union of the firstpos of each argument. */
         nfirstpos[-2] += nfirstpos[-1];
         --nfirstpos;
@@ -3725,7 +3715,6 @@ dfamust (struct dfa *d)
           resetmust(mp);
           break;
         case OR:
-        case ORTOP:
           assert (&musts[2] <= mp);
           {
             char **new;

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=2b2b4e96fdfacf184c32f97ba2050b1318740420


commit 0f4afc66be2e4c48d1f7b6b2c02122fbe5222921
Author: Paolo Bonzini <address@hidden>
Date:   Sat Apr 17 04:02:31 2010 +0200

    dfa: drop ORTOP
    
    * src/dfa.c (token, prtok, addtok_mb, nsubtoks, dfaanalyze, dfamust):
    Remove ORTOP.
    (regexp): Remove parameter, always add OR at the end, adjust callers.
    (atom): Adjust caller.
    (dfaparse): Adjust caller.  Always add OR at the end.

diff --git a/src/dfa.c b/src/dfa.c
index 9b67240..fe093a8 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -207,9 +207,6 @@ typedef enum
   OR,                          /* OR is an operator of two arguments that
                                    matches either of its arguments. */
 
-  ORTOP,                       /* OR at the toplevel in the parse tree.
-                                   This is used for a boyer-moore heuristic. */
-
   LPAREN,                      /* LPAREN never appears in the parse tree,
                                    it is only a lexeme. */
 
@@ -401,7 +398,7 @@ struct dfa
                        prevn, currn, prevl, currl)
 
 static void dfamust (struct dfa *dfa);
-static void regexp (int toplevel);
+static void regexp (void);
 
 #define CALLOC(p, t, n) ((p) = xcalloc((size_t)(n), sizeof (t)))
 #define MALLOC(p, t, n) ((p) = xmalloc((n) * sizeof (t)))
@@ -446,7 +443,6 @@ prtok (token t)
         case PLUS: s = "PLUS"; break;
         case CAT: s = "CAT"; break;
         case OR: s = "OR"; break;
-        case ORTOP: s = "ORTOP"; break;
         case LPAREN: s = "LPAREN"; break;
         case RPAREN: s = "RPAREN"; break;
 #if MBS_SUPPORT
@@ -1417,7 +1413,6 @@ addtok_mb (token t, int mbprop)
 
     case CAT:
     case OR:
-    case ORTOP:
       --depth;
       break;
 
@@ -1543,7 +1538,7 @@ atom (void)
   else if (tok == LPAREN)
     {
       tok = lex();
-      regexp(0);
+      regexp();
       if (tok != RPAREN)
         dfaerror(_("unbalanced ("));
       tok = lex();
@@ -1568,7 +1563,6 @@ nsubtoks (int tindex)
       return 1 + nsubtoks(tindex - 1);
     case CAT:
     case OR:
-    case ORTOP:
       ntoks1 = nsubtoks(tindex - 1);
       return 1 + ntoks1 + nsubtoks(tindex - 1 - ntoks1);
     }
@@ -1644,17 +1638,14 @@ branch (void)
 }
 
 static void
-regexp (int toplevel)
+regexp (void)
 {
   branch();
   while (tok == OR)
     {
       tok = lex();
       branch();
-      if (toplevel)
-        addtok(ORTOP);
-      else
-        addtok(OR);
+      addtok(OR);
     }
 }
 
@@ -1687,7 +1678,7 @@ dfaparse (char const *s, size_t len, struct dfa *d)
   tok = lex();
   depth = d->depth;
 
-  regexp(1);
+  regexp();
 
   if (tok != END)
     dfaerror(_("unbalanced )"));
@@ -1696,7 +1687,7 @@ dfaparse (char const *s, size_t len, struct dfa *d)
   addtok(CAT);
 
   if (d->nregexps)
-    addtok(ORTOP);
+    addtok(OR);
 
   ++d->nregexps;
 }
@@ -2092,7 +2083,6 @@ dfaanalyze (struct dfa *d, int searchflag)
         break;
 
       case OR:
-      case ORTOP:
         /* The firstpos is the union of the firstpos of each argument. */
         nfirstpos[-2] += nfirstpos[-1];
         --nfirstpos;
@@ -3725,7 +3715,6 @@ dfamust (struct dfa *d)
           resetmust(mp);
           break;
         case OR:
-        case ORTOP:
           assert (&musts[2] <= mp);
           {
             char **new;

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=1e2a331e159b2313126ee99c768649dc07d81692


commit 0f4afc66be2e4c48d1f7b6b2c02122fbe5222921
Author: Paolo Bonzini <address@hidden>
Date:   Sat Apr 17 04:02:31 2010 +0200

    dfa: drop ORTOP
    
    * src/dfa.c (token, prtok, addtok_mb, nsubtoks, dfaanalyze, dfamust):
    Remove ORTOP.
    (regexp): Remove parameter, always add OR at the end, adjust callers.
    (atom): Adjust caller.
    (dfaparse): Adjust caller.  Always add OR at the end.

diff --git a/src/dfa.c b/src/dfa.c
index 9b67240..fe093a8 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -207,9 +207,6 @@ typedef enum
   OR,                          /* OR is an operator of two arguments that
                                    matches either of its arguments. */
 
-  ORTOP,                       /* OR at the toplevel in the parse tree.
-                                   This is used for a boyer-moore heuristic. */
-
   LPAREN,                      /* LPAREN never appears in the parse tree,
                                    it is only a lexeme. */
 
@@ -401,7 +398,7 @@ struct dfa
                        prevn, currn, prevl, currl)
 
 static void dfamust (struct dfa *dfa);
-static void regexp (int toplevel);
+static void regexp (void);
 
 #define CALLOC(p, t, n) ((p) = xcalloc((size_t)(n), sizeof (t)))
 #define MALLOC(p, t, n) ((p) = xmalloc((n) * sizeof (t)))
@@ -446,7 +443,6 @@ prtok (token t)
         case PLUS: s = "PLUS"; break;
         case CAT: s = "CAT"; break;
         case OR: s = "OR"; break;
-        case ORTOP: s = "ORTOP"; break;
         case LPAREN: s = "LPAREN"; break;
         case RPAREN: s = "RPAREN"; break;
 #if MBS_SUPPORT
@@ -1417,7 +1413,6 @@ addtok_mb (token t, int mbprop)
 
     case CAT:
     case OR:
-    case ORTOP:
       --depth;
       break;
 
@@ -1543,7 +1538,7 @@ atom (void)
   else if (tok == LPAREN)
     {
       tok = lex();
-      regexp(0);
+      regexp();
       if (tok != RPAREN)
         dfaerror(_("unbalanced ("));
       tok = lex();
@@ -1568,7 +1563,6 @@ nsubtoks (int tindex)
       return 1 + nsubtoks(tindex - 1);
     case CAT:
     case OR:
-    case ORTOP:
       ntoks1 = nsubtoks(tindex - 1);
       return 1 + ntoks1 + nsubtoks(tindex - 1 - ntoks1);
     }
@@ -1644,17 +1638,14 @@ branch (void)
 }
 
 static void
-regexp (int toplevel)
+regexp (void)
 {
   branch();
   while (tok == OR)
     {
       tok = lex();
       branch();
-      if (toplevel)
-        addtok(ORTOP);
-      else
-        addtok(OR);
+      addtok(OR);
     }
 }
 
@@ -1687,7 +1678,7 @@ dfaparse (char const *s, size_t len, struct dfa *d)
   tok = lex();
   depth = d->depth;
 
-  regexp(1);
+  regexp();
 
   if (tok != END)
     dfaerror(_("unbalanced )"));
@@ -1696,7 +1687,7 @@ dfaparse (char const *s, size_t len, struct dfa *d)
   addtok(CAT);
 
   if (d->nregexps)
-    addtok(ORTOP);
+    addtok(OR);
 
   ++d->nregexps;
 }
@@ -2092,7 +2083,6 @@ dfaanalyze (struct dfa *d, int searchflag)
         break;
 
       case OR:
-      case ORTOP:
         /* The firstpos is the union of the firstpos of each argument. */
         nfirstpos[-2] += nfirstpos[-1];
         --nfirstpos;
@@ -3725,7 +3715,6 @@ dfamust (struct dfa *d)
           resetmust(mp);
           break;
         case OR:
-        case ORTOP:
           assert (&musts[2] <= mp);
           {
             char **new;

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

Summary of changes:
 NEWS                 |    2 +
 src/dfa.c            |   62 ++++++++++++-------------------------------------
 src/dfa.h            |    6 -----
 tests/spencer1.tests |    9 +++++++
 4 files changed, 26 insertions(+), 53 deletions(-)


hooks/post-receive
-- 
grep




reply via email to

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