gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-466


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-466-g3b13df1
Date: Wed, 29 Oct 2014 19:14:32 +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 "gawk".

The branch, gawk-4.1-stable has been updated
       via  3b13df110f42b26417de73151eb4a03657e85de4 (commit)
      from  d8018f6f8957cb67920904f08377608a7cc78307 (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.sv.gnu.org/cgit/gawk.git/commit/?id=3b13df110f42b26417de73151eb4a03657e85de4

commit 3b13df110f42b26417de73151eb4a03657e85de4
Author: Arnold D. Robbins <address@hidden>
Date:   Wed Oct 29 21:14:17 2014 +0200

    Sync dfa with grep.

diff --git a/ChangeLog b/ChangeLog
index 178e45f..34554e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-29         Arnold D. Robbins     <address@hidden>
+
+       * dfa.c: Sync with GNU grep. Again, again.
+
 2014-10-28         Arnold D. Robbins     <address@hidden>
 
        * dfa.c: Sync with GNU grep. Again.
diff --git a/dfa.c b/dfa.c
index c299da1..e658ad8 100644
--- a/dfa.c
+++ b/dfa.c
@@ -1317,6 +1317,20 @@ parse_bracket_exp (void)
   return CSET + charclass_index (ccl);
 }
 
+#define PUSH_LEX_STATE(s)                      \
+  do                                           \
+    {                                          \
+      char const *lexptr_saved = lexptr;       \
+      size_t lexleft_saved = lexleft;          \
+      lexptr = (s);                            \
+      lexleft = strlen (lexptr)
+
+#define POP_LEX_STATE()                                \
+      lexptr = lexptr_saved;                   \
+      lexleft = lexleft_saved;                 \
+    }                                          \
+  while (0)
+
 static token
 lex (void)
 {
@@ -1564,20 +1578,6 @@ lex (void)
               return lasttok = CSET + charclass_index (ccl);
             }
 
-#define PUSH_LEX_STATE(s)                      \
-  do                                           \
-    {                                          \
-      char const *lexptr_saved = lexptr;       \
-      size_t lexleft_saved = lexleft;          \
-      lexptr = (s);                            \
-      lexleft = strlen (lexptr)
-
-#define POP_LEX_STATE()                                \
-      lexptr = lexptr_saved;                   \
-      lexleft = lexleft_saved;                 \
-    }                                          \
-  while (0)
-
           /* FIXME: see if optimizing this, as is done with ANYCHAR and
              add_utf8_anychar, makes sense.  */
 
@@ -1597,14 +1597,33 @@ lex (void)
         case 'W':
           if (!backslash || (syntax_bits & RE_NO_GNU_OPS))
             goto normal_char;
-          zeroset (ccl);
-          for (c2 = 0; c2 < NOTCHAR; ++c2)
-            if (IS_WORD_CONSTITUENT (c2))
-              setbit (c2, ccl);
-          if (c == 'W')
-            notset (ccl);
+
+          if (!dfa->multibyte)
+            {
+              zeroset (ccl);
+              for (c2 = 0; c2 < NOTCHAR; ++c2)
+                if (IS_WORD_CONSTITUENT (c2))
+                  setbit (c2, ccl);
+              if (c == 'W')
+                notset (ccl);
+              laststart = false;
+              return lasttok = CSET + charclass_index (ccl);
+            }
+
+          /* FIXME: see if optimizing this, as is done with ANYCHAR and
+             add_utf8_anychar, makes sense.  */
+
+          /* \w and \W are documented to be equivalent to [_[:alnum:]] and
+             [^_[:alnum:]] respectively, so tell the lexer to process those
+             strings, each minus its "already processed" '['.  */
+          PUSH_LEX_STATE (c == 'w' ? "_[:alnum:]]" : "^_[:alnum:]]");
+
+          lasttok = parse_bracket_exp ();
+
+          POP_LEX_STATE ();
+
           laststart = false;
-          return lasttok = CSET + charclass_index (ccl);
+          return lasttok;
 
         case '[':
           if (backslash)

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

Summary of changes:
 ChangeLog |    4 ++++
 dfa.c     |   61 ++++++++++++++++++++++++++++++++++++++++---------------------
 2 files changed, 44 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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