gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1493-g5cb179


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1493-g5cb179d
Date: Mon, 29 Jun 2015 17:37:19 +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, master has been updated
       via  5cb179dbcfe1503b2eaffa87b5f7502f41482be2 (commit)
      from  2befea585a321d9d092bfb99cbfa65350a839752 (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=5cb179dbcfe1503b2eaffa87b5f7502f41482be2

commit 5cb179dbcfe1503b2eaffa87b5f7502f41482be2
Author: Arnold D. Robbins <address@hidden>
Date:   Mon Jun 29 20:36:50 2015 +0300

    Debugger fix, eval for builtin extensions + test.

diff --git a/ChangeLog b/ChangeLog
index a526706..51ab8fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-06-29         Arnold D. Robbins     <address@hidden>
+
+       * awkgram.y (yylex): If gawk extension function is found as
+       a function in a user-defined function body, treat it normally.
+       Makes eval "print and(a, 1)" work in the debugger again.
+       Thanks, yet again, to Hermann Peifer.
+
 2015-06-28         Arnold D. Robbins     <address@hidden>
 
        Improve memory tracking of typed regexps.
diff --git a/awkgram.c b/awkgram.c
index 0ee3e66..6871097 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -6426,14 +6426,20 @@ retry:
 
                /* allow parameter names to shadow the names of gawk extension 
built-ins */
                if ((tokentab[mid].flags & GAWKX) != 0) {
+                       NODE *f;
+
                        switch (want_param_names) {
                        case FUNC_HEADER:
                                /* in header, defining parameter names */
                                goto out;
                        case FUNC_BODY:
                                /* in body, name must be in symbol table for it 
to be a parameter */
-                               if (lookup(tokstart) != NULL)
-                                       goto out;
+                               if ((f = lookup(tokstart)) != NULL) {
+                                       if (f->type == Node_builtin_func)
+                                               break;
+                                       else
+                                               goto out;
+                               }
                                /* else
                                        fall through */
                        case DONT_CHECK:
diff --git a/awkgram.y b/awkgram.y
index 4f22379..18530eb 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -4006,14 +4006,20 @@ retry:
 
                /* allow parameter names to shadow the names of gawk extension 
built-ins */
                if ((tokentab[mid].flags & GAWKX) != 0) {
+                       NODE *f;
+
                        switch (want_param_names) {
                        case FUNC_HEADER:
                                /* in header, defining parameter names */
                                goto out;
                        case FUNC_BODY:
                                /* in body, name must be in symbol table for it 
to be a parameter */
-                               if (lookup(tokstart) != NULL)
-                                       goto out;
+                               if ((f = lookup(tokstart)) != NULL) {
+                                       if (f->type == Node_builtin_func)
+                                               break;
+                                       else
+                                               goto out;
+                               }
                                /* else
                                        fall through */
                        case DONT_CHECK:
diff --git a/test/ChangeLog b/test/ChangeLog
index f29dea7..c9a8e30 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2015-06-29         Arnold D. Robbins     <address@hidden>
+
+       * Makefile.am (dbugeval2): New test.
+       * dbugeval2.awk, dbugeval2.in, dbugeval2.ok: New files.
+       Thanks to Hermann Peifer for the report.
+
 2015-06-28         Arnold D. Robbins     <address@hidden>
 
        * Makefile.am (typedregex2): New test.
diff --git a/test/Makefile.am b/test/Makefile.am
index df1f1e2..f646bc0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -177,6 +177,9 @@ EXTRA_DIST = \
        datanonl.ok \
        dbugeval.in \
        dbugeval.ok \
+       dbugeval2.awk \
+       dbugeval2.in \
+       dbugeval2.ok \
        dbugtypedre1.awk \
        dbugtypedre1.in \
        dbugtypedre1.ok \
@@ -1093,7 +1096,7 @@ UNIX_TESTS = \
 GAWK_EXT_TESTS = \
        aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
        backw badargs beginfile1 beginfile2 binmode1 charasbytes \
-       colonwarn clos1way crlf dbugeval dbugtypedre1 dbugtypedre2 delsub \
+       colonwarn clos1way crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 
delsub \
        devfd devfd1 devfd2 dumpvars errno exit \
        fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \
        functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
@@ -2151,6 +2154,11 @@ dbugtypedre2:
        @AWKPATH="$(srcdir)" $(AWK) -D -f address@hidden < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+dbugeval2:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -D -f address@hidden < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 # Targets generated for other tests:
 include Maketests
 
diff --git a/test/Makefile.in b/test/Makefile.in
index ec270c1..981b637 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -434,6 +434,9 @@ EXTRA_DIST = \
        datanonl.ok \
        dbugeval.in \
        dbugeval.ok \
+       dbugeval2.awk \
+       dbugeval2.in \
+       dbugeval2.ok \
        dbugtypedre1.awk \
        dbugtypedre1.in \
        dbugtypedre1.ok \
@@ -1349,7 +1352,7 @@ UNIX_TESTS = \
 GAWK_EXT_TESTS = \
        aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
        backw badargs beginfile1 beginfile2 binmode1 charasbytes \
-       colonwarn clos1way crlf dbugeval dbugtypedre1 dbugtypedre2 delsub \
+       colonwarn clos1way crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 
delsub \
        devfd devfd1 devfd2 dumpvars errno exit \
        fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \
        functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
@@ -2586,6 +2589,11 @@ dbugtypedre2:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -D -f address@hidden < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
+dbugeval2:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -D -f address@hidden < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 Gt-dummy:
 # file Maketests, generated from Makefile.am by the Gentests program
 addcomma:
diff --git a/test/dbugeval2.awk b/test/dbugeval2.awk
new file mode 100644
index 0000000..4997d1b
--- /dev/null
+++ b/test/dbugeval2.awk
@@ -0,0 +1,4 @@
+BEGIN {
+       a = 2
+       b = 3
+}
diff --git a/test/dbugeval2.in b/test/dbugeval2.in
new file mode 100644
index 0000000..165f714
--- /dev/null
+++ b/test/dbugeval2.in
@@ -0,0 +1,3 @@
+b 3
+r
+eval "print and(a, 3)"
diff --git a/test/dbugeval2.ok b/test/dbugeval2.ok
new file mode 100644
index 0000000..4d64526
--- /dev/null
+++ b/test/dbugeval2.ok
@@ -0,0 +1,7 @@
+Breakpoint 1 set at file `dbugeval2.awk', line 3
+Starting program: 
+Stopping in BEGIN ...
+Breakpoint 1, main() at `dbugeval2.awk':3
+3              b = 3
+2
+EXIT CODE: 2

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

Summary of changes:
 ChangeLog          |    7 +++++++
 awkgram.c          |   10 ++++++++--
 awkgram.y          |   10 ++++++++--
 test/ChangeLog     |    6 ++++++
 test/Makefile.am   |   10 +++++++++-
 test/Makefile.in   |   10 +++++++++-
 test/dbugeval2.awk |    4 ++++
 test/dbugeval2.in  |    3 +++
 test/dbugeval2.ok  |    7 +++++++
 9 files changed, 61 insertions(+), 6 deletions(-)
 create mode 100644 test/dbugeval2.awk
 create mode 100644 test/dbugeval2.in
 create mode 100644 test/dbugeval2.ok


hooks/post-receive
-- 
gawk



reply via email to

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