[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, master, updated. 0961d7b8cc08365bc82f741
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, master, updated. 0961d7b8cc08365bc82f7410a013517a839d683e |
Date: |
Thu, 11 Oct 2012 17:32:56 +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 0961d7b8cc08365bc82f7410a013517a839d683e (commit)
via 921f9dd3b97236892c632e15c1a8f35ce3e74533 (commit)
from 8eb78103a37e75819388c2a175caf40bf0f7b4c9 (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=0961d7b8cc08365bc82f7410a013517a839d683e
commit 0961d7b8cc08365bc82f7410a013517a839d683e
Author: Arnold D. Robbins <address@hidden>
Date: Thu Oct 11 19:32:34 2012 +0200
Bug fix for new symbol table implementation.
diff --git a/ChangeLog b/ChangeLog
index d66f2aa..9222c70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-10-11 Arnold D. Robbins <address@hidden>
+
+ * awk.h (dup_ent): New member for Node_param_list.
+ * symbol.c (install): For parameters, if this is a duplicate, chain
+ it off the original using the dup_ent pointer.
+ (remove_params): If there's a duplicate, remove it from the list.
+
2012-10-10 Arnold D. Robbins <address@hidden>
* gawkapi.h: Add considerably more documentation. Rearrange order
diff --git a/awk.h b/awk.h
index f7f4120..c2a6558 100644
--- a/awk.h
+++ b/awk.h
@@ -463,6 +463,7 @@ typedef struct exp_node {
/* Node_param_list */
#define param vname
+#define dup_ent sub.nodep.r.rptr
/* Node_param_list, Node_func */
#define param_cnt sub.nodep.l.ll
diff --git a/symbol.c b/symbol.c
index afec731..3776f90 100644
--- a/symbol.c
+++ b/symbol.c
@@ -185,10 +185,17 @@ remove_params(NODE *func)
for (i = pcount - 1; i >= 0; i--) {
NODE *tmp;
+ NODE *tmp2;
p = parms + i;
+ assert(p->type == Node_param_list);
tmp = make_string(p->vname, strlen(p->vname));
- (void) assoc_remove(param_table, tmp);
+ tmp2 = in_array(param_table, tmp);
+ if (tmp2 != NULL && tmp2->dup_ent != NULL) {
+ tmp2->dup_ent = tmp2->dup_ent->dup_ent;
+ } else {
+ (void) assoc_remove(param_table, tmp);
+ }
unref(tmp);
}
@@ -291,6 +298,7 @@ install(char *name, NODE *parm, NODETYPE type)
NODE **aptr;
NODE *table;
NODE *n_name;
+ NODE *prev;
n_name = make_string(name, strlen(name));
table = symbol_table;
@@ -314,9 +322,19 @@ install(char *name, NODE *parm, NODETYPE type)
var_count++; /* total, includes Node_func */
}
- aptr = assoc_lookup(table, n_name);
- unref(*aptr);
- *aptr = r;
+ if (type == Node_param_list) {
+ prev = in_array(table, n_name);
+ if (prev == NULL)
+ goto simple;
+ r->dup_ent = prev->dup_ent;
+ prev->dup_ent = r;
+ } else {
+simple:
+ /* the simple case */
+ aptr = assoc_lookup(table, n_name);
+ unref(*aptr);
+ *aptr = r;
+ }
unref(n_name);
if (install_func)
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=921f9dd3b97236892c632e15c1a8f35ce3e74533
commit 921f9dd3b97236892c632e15c1a8f35ce3e74533
Author: Arnold D. Robbins <address@hidden>
Date: Thu Oct 11 19:31:58 2012 +0200
Minor doc update in FUTURES.
diff --git a/FUTURES b/FUTURES
index e42cd01..ba1f1b2 100644
--- a/FUTURES
+++ b/FUTURES
@@ -24,7 +24,8 @@ For 4.1
DONE: Redo the loadable modules interface from the awk level.
- DONE: SYMTAB functionality.
+ DONE: Consider really implementing BWK awk SYMTAB for seeing what
+ global variables are defined.
Continue code reviews / code cleanup
@@ -56,9 +57,6 @@ For 4.2
??? Gnulib
- Consider really implementing BWK awk SYMTAB for seeing what
- global variables are defined.
-
Probably never:
===============
Do an optimization pass over parse tree?
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
FUTURES | 6 ++----
awk.h | 1 +
symbol.c | 26 ++++++++++++++++++++++----
4 files changed, 32 insertions(+), 8 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, master, updated. 0961d7b8cc08365bc82f7410a013517a839d683e,
Arnold Robbins <=