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-4145-gfb56b3b


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4145-gfb56b3b
Date: Fri, 9 Oct 2020 03:39:09 -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  fb56b3b1ac97ff172d8e4b72f4b6aa90a9bfccd5 (commit)
      from  bff808d84a237098ef9b6f542f45a8442a0f536f (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=fb56b3b1ac97ff172d8e4b72f4b6aa90a9bfccd5

commit fb56b3b1ac97ff172d8e4b72f4b6aa90a9bfccd5
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Oct 9 10:38:57 2020 +0300

    Bug fix to test/xref.awk.

diff --git a/test/ChangeLog b/test/ChangeLog
index 0c913b0..6bd4dd1 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,10 @@
+2020-10-09         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * xref.awk: Bug fix: Identifiers can have underscore in the middle.
+       Thanks to Tom Gray <tom_gray@sonic.net> for the report, way
+       back on Wed, 25 Jan 2012.
+       * profile2.ok: Updated after above code change.
+
 2020-10-05         Arnold D. Robbins     <arnold@skeeve.com>
 
        * iolint.awk, iolint.ok: Remove |& test to cat. It was
diff --git a/test/profile2.ok b/test/profile2.ok
index 1db4c2f..3369a11 100644
--- a/test/profile2.ok
+++ b/test/profile2.ok
@@ -7,29 +7,29 @@
      1         asplit("BEGIN:END:atan2:break:close:continue:cos:delete:" 
"do:else:exit:exp:for:getline:gsub:if:in:index:int:" 
"length:log:match:next:print:printf:rand:return:sin:" 
"split:sprintf:sqrt:srand:sub:substr:system:while", keywords, ":")
      1         split("00:00:00:00:00:00:00:00:00:00:" 
"20:10:10:12:12:11:07:00:00:00:" "08:08:08:08:08:33:08:00:00:00:" 
"08:44:08:36:08:08:08:00:00:00:" "08:44:45:42:42:41:08", machine, ":")
      1         state = 1
-   571         for (;;) {
-   571                 symb = lex()
-   571                 nextstate = substr(machine[state symb], 1, 1)
-   571                 act = substr(machine[state symb], 2, 1)
-   571                 if (act == "0") { # 12
-   559                 } else if (act == "1") { # 8
+   570         for (;;) {
+   570                 symb = lex()
+   570                 nextstate = substr(machine[state symb], 1, 1)
+   570                 act = substr(machine[state symb], 2, 1)
+   570                 if (act == "0") { # 12
+   558                 } else if (act == "1") { # 8
      8                         if (! inarray(tok, names)) { # 3
      3                                 names[++nnames] = tok
                                }
      8                         lines[tok, ++xnames[tok]] = NR
-   551                 } else if (act == "2") { # 426
-   426                         if (tok in local) { # 309
+   550                 } else if (act == "2") { # 425
+   425                         if (tok in local) { # 309
    309                                 tok = tok "(" funcname ")"
    309                                 if (! inarray(tok, names)) { # 22
     22                                         names[++nnames] = tok
                                        }
    309                                 lines[tok, ++xnames[tok]] = NR
-   117                         } else {
-   117                                 tok = tok "()"
-   117                                 if (! inarray(tok, names)) { # 22
-    22                                         names[++nnames] = tok
+   116                         } else {
+   116                                 tok = tok "()"
+   116                                 if (! inarray(tok, names)) { # 21
+    21                                         names[++nnames] = tok
                                        }
-   117                                 lines[tok, ++xnames[tok]] = NR
+   116                                 lines[tok, ++xnames[tok]] = NR
                                }
    125                 } else if (act == "3") { # 4
      4                         funcname = tok
@@ -53,21 +53,21 @@
                                print("error: xref.awk: line " NR ": aborting") 
> "/dev/con"
                                exit 1
                        }
-   570                 state = nextstate
+   569                 state = nextstate
                }
-    47         for (i = 1; i <= nnames; i++) {
-    47                 printf("%d ", xnames[names[i]]) | sortcmd
-    47                 if (index(names[i], "(") == 0) { # 3
+    46         for (i = 1; i <= nnames; i++) {
+    46                 printf("%d ", xnames[names[i]]) | sortcmd
+    46                 if (index(names[i], "(") == 0) { # 3
      3                         printf("%s(%d)", names[i], flines[names[i]]) | 
sortcmd
-    44                 } else {
-    44                         printf("%s", names[i]) | sortcmd
+    43                 } else {
+    43                         printf("%s", names[i]) | sortcmd
                        }
-   434                 for (j = 1; j <= xnames[names[i]]; j++) {
-   434                         if (lines[names[i], j] != lines[names[i], j - 
1]) { # 390
-   390                                 printf(" %d", lines[names[i], j]) | 
sortcmd
+   433                 for (j = 1; j <= xnames[names[i]]; j++) {
+   433                         if (lines[names[i], j] != lines[names[i], j - 
1]) { # 389
+   389                                 printf(" %d", lines[names[i], j]) | 
sortcmd
                                }
                        }
-    47                 printf("\n") | sortcmd
+    46                 printf("\n") | sortcmd
                }
      1         close(sortcmd)
        }
@@ -83,18 +83,18 @@
                }
        }
 
-   434  function inarray(val, arr, j, tmp)
+   433  function inarray(val, arr, j, tmp)
        {
- 16297         for (j in arr) {
- 16297                 tmp[arr[j]]++
+ 15872         for (j in arr) {
+ 15872                 tmp[arr[j]]++
                }
-   434         return (val in tmp)
+   433         return (val in tmp)
        }
 
-   571  function lex()
+   570  function lex()
        {
-  1702         for (;;) {
-  1702                 if (tok == "(eof)") {
+  1698         for (;;) {
+  1698                 if (tok == "(eof)") {
                                return 7
                        }
    326                 while (length(line) == 0) {
@@ -103,37 +103,37 @@
      1                                 return 7
                                }
                        }
-  1701                 sub(/^[ \t]+/, "", line)
-  1701                 sub(/^"([^"]|\\")*"/, "", line)
-  1701                 sub(/^\/([^\/]|\\\/)+\//, "", line)
-  1701                 sub(/^#.*/, "", line)
-  1701                 if (line ~ /^function/) { # 4
+  1697                 sub(/^[ \t]+/, "", line)
+  1697                 sub(/^"([^"]|\\")*"/, "", line)
+  1697                 sub(/^\/([^\/]|\\\/)+\//, "", line)
+  1697                 sub(/^#.*/, "", line)
+  1697                 if (line ~ /^function/) { # 4
      4                         tok = "function"
      4                         line = substr(line, 9)
      4                         return 1
-  1697                 } else if (line ~ /^{/) { # 53
+  1693                 } else if (line ~ /^{/) { # 53
     53                         tok = "{"
     53                         line = substr(line, 2)
     53                         return 2
-  1644                 } else if (line ~ /^}/) { # 53
+  1640                 } else if (line ~ /^}/) { # 53
     53                         tok = "}"
     53                         line = substr(line, 2)
     53                         return 3
-  1591                 } else if (match(line, /^[[:alpha:]_][[:alnum:]]*\[/)) 
{ # 43
+  1587                 } else if (match(line, /^[[:alpha:]_][[:alnum:]_]*\[/)) 
{ # 43
     43                         tok = substr(line, 1, RLENGTH - 1)
     43                         line = substr(line, RLENGTH + 1)
     43                         return 5
-  1548                 } else if (match(line, /^[[:alpha:]_][[:alnum:]]*\(/)) 
{ # 87
+  1544                 } else if (match(line, /^[[:alpha:]_][[:alnum:]_]*\(/)) 
{ # 87
     87                         tok = substr(line, 1, RLENGTH - 1)
     87                         line = substr(line, RLENGTH + 1)
     87                         if (! (tok in keywords)) { # 12
     12                                 return 6
                                }
-  1461                 } else if (match(line, /^[[:alpha:]_][[:alnum:]]*/)) { 
# 525
-   525                         tok = substr(line, 1, RLENGTH)
-   525                         line = substr(line, RLENGTH + 1)
-   525                         if (! (tok in keywords)) { # 405
-   405                                 return 4
+  1457                 } else if (match(line, /^[[:alpha:]_][[:alnum:]_]*/)) { 
# 521
+   521                         tok = substr(line, 1, RLENGTH)
+   521                         line = substr(line, RLENGTH + 1)
+   521                         if (! (tok in keywords)) { # 404
+   404                                 return 4
                                }
    936                 } else {
    936                         match(line, /^[^[:alpha:]_{}]/)
diff --git a/test/xref.awk b/test/xref.awk
index d23a0c8..599aaa4 100644
--- a/test/xref.awk
+++ b/test/xref.awk
@@ -3,6 +3,8 @@
        # 12/2010: Modified for gawk test suite to use a variable
        # for the sort command and to use `sort -k1' instead of `sort +1'
 
+       # 10/2020: Bug fix applied to code.
+
         BEGIN {
                if (sortcmd == "") sortcmd = "sort"             # "sort -k1"
 
@@ -121,15 +123,15 @@
                         else if ( line ~ /^}/ ) {
                                 tok = "}"; line = substr(line,2); return 3 }
                        # change regexes to use posix character classes
-                        else if ( match(line,/^[[:alpha:]_][[:alnum:]]*\[/) ) {
+                        else if ( match(line,/^[[:alpha:]_][[:alnum:]_]*\[/) ) 
{
                                 tok = substr(line,1,RLENGTH-1)
                                 line = substr(line,RLENGTH+1)
                                 return 5 }
-                        else if ( match(line,/^[[:alpha:]_][[:alnum:]]*\(/) ) {
+                        else if ( match(line,/^[[:alpha:]_][[:alnum:]_]*\(/) ) 
{
                                 tok = substr(line,1,RLENGTH-1)
                                 line = substr(line,RLENGTH+1)
                                 if ( ! ( tok in keywords ) ) return 6 }
-                        else if ( match(line,/^[[:alpha:]_][[:alnum:]]*/) ) {
+                        else if ( match(line,/^[[:alpha:]_][[:alnum:]_]*/) ) {
                                 tok = substr(line,1,RLENGTH)
                                 line = substr(line,RLENGTH+1)
                                 if ( ! ( tok in keywords ) ) return 4 }

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

Summary of changes:
 test/ChangeLog   |  7 +++++
 test/profile2.ok | 88 ++++++++++++++++++++++++++++----------------------------
 test/xref.awk    |  8 ++++--
 3 files changed, 56 insertions(+), 47 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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