gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4392-g1048bef9


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4392-g1048bef9
Date: Thu, 21 Apr 2022 03:47:04 -0400 (EDT)

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-5.1-stable has been updated
       via  1048bef9a1fe499c4f864425b3c75995333a474a (commit)
      from  c16ed6dbd8ecb24dc7f3eaf11e8bef13ef4c6580 (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=1048bef9a1fe499c4f864425b3c75995333a474a

commit 1048bef9a1fe499c4f864425b3c75995333a474a
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Thu Apr 21 10:46:42 2022 +0300

    Improvements in helpers/testdfa.c.

diff --git a/helpers/ChangeLog b/helpers/ChangeLog
index 3a21a379..3b94b48b 100644
--- a/helpers/ChangeLog
+++ b/helpers/ChangeLog
@@ -1,3 +1,8 @@
+2022-04-21         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * testdfa.c: Several general improvements and additions to sync
+       with gawk's code.
+
 2021-10-27         Arnold D. Robbins     <arnold@skeeve.com>
 
        * 5.1.1: Release tar ball made.
diff --git a/helpers/testdfa.c b/helpers/testdfa.c
index 426aab8f..3f2f1067 100644
--- a/helpers/testdfa.c
+++ b/helpers/testdfa.c
@@ -164,6 +164,7 @@ int main(int argc, char **argv)
                pat.translate = NULL;
                syn &= ~RE_ICASE;
        }
+       pat.allocated = 0;
 
 
        dfa_syn = syn;
@@ -183,7 +184,7 @@ int main(int argc, char **argv)
 
        dfareg = dfaalloc();
        init_localeinfo(&localeinfo);
-       dfasyntax(dfareg, &localeinfo, dfa_syn, 0);
+       dfasyntax(dfareg, &localeinfo, dfa_syn, DFA_ANCHOR);
 
        printf("Calling dfacomp(%s, %d, %p, true)\n",
                        pattern, (int) len, dfareg);
@@ -194,9 +195,43 @@ int main(int argc, char **argv)
        data = databuf(STDIN_FILENO);
        len = strlen(data);
 
+       if (data[len-1] == '\n')
+               data[--len] = '\0';     // clobber newline
+
+       printf("data: <%s>\n", data);
+
        /* run the regex matcher */
+       ret = re_search(& pat, data, len, 0, len, NULL);
+       printf("re_search with NULL returned position %d (%s)\n", ret, (ret >= 
0) ? "true" : "false");
+#if 0
+       printf("pat.allocated = %ld\n", pat.allocated);
+       printf("pat.used = %ld\n", pat.used);
+       printf("pat.syntax = %ld\n", pat.syntax);
+       printf("pat.re_nsub = %ld\n", pat.re_nsub);
+       printf("pat.can_be_null = %d\n", pat.can_be_null);
+       printf("pat.regs_allocated = %d\n", pat.regs_allocated);
+       printf("pat.fastmap_accurate = %d\n", pat.fastmap_accurate);
+       printf("pat.no_sub = %d\n", pat.no_sub);
+       printf("pat.not_bol = %d\n", pat.not_bol);
+       printf("pat.not_eol = %d\n", pat.not_eol);
+       printf("pat.newline_anchor = %d\n", pat.newline_anchor);
+#endif
+
        ret = re_search(& pat, data, len, 0, len, &regs);
        printf("re_search returned position %d (%s)\n", ret, (ret >= 0) ? 
"true" : "false");
+#if 0
+       printf("pat.allocated = %ld\n", pat.allocated);
+       printf("pat.used = %ld\n", pat.used);
+       printf("pat.syntax = %ld\n", pat.syntax);
+       printf("pat.re_nsub = %ld\n", pat.re_nsub);
+       printf("pat.can_be_null = %d\n", pat.can_be_null);
+       printf("pat.regs_allocated = %d\n", pat.regs_allocated);
+       printf("pat.fastmap_accurate = %d\n", pat.fastmap_accurate);
+       printf("pat.no_sub = %d\n", pat.no_sub);
+       printf("pat.not_bol = %d\n", pat.not_bol);
+       printf("pat.not_eol = %d\n", pat.not_eol);
+       printf("pat.newline_anchor = %d\n", pat.newline_anchor);
+#endif
 
        /* run the dfa matcher */
        /*

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

Summary of changes:
 helpers/ChangeLog |  5 +++++
 helpers/testdfa.c | 37 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 41 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
gawk



reply via email to

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