aboutsummaryrefslogtreecommitdiffstats
path: root/interpret.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-10-04 12:04:34 +0200
committerArnold D. Robbins <arnold@skeeve.com>2012-10-04 12:04:34 +0200
commit81896b422307105edb9908958bbedd09967d9a05 (patch)
tree89421f3e15278d3d6a6bbd15066465e0bc62a2fd /interpret.h
parent3d9b832439afeb1b05c60831e0865df585dc55ac (diff)
downloadegawk-81896b422307105edb9908958bbedd09967d9a05.tar.gz
egawk-81896b422307105edb9908958bbedd09967d9a05.tar.bz2
egawk-81896b422307105edb9908958bbedd09967d9a05.zip
Add tests for SYMTAB and FUNCTAB.
Diffstat (limited to 'interpret.h')
-rw-r--r--interpret.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/interpret.h b/interpret.h
index 5bd3e3a6..ab6c9b33 100644
--- a/interpret.h
+++ b/interpret.h
@@ -212,6 +212,12 @@ top:
/* for FUNCTAB, get the name as the element value */
if (t1 == func_table) {
+ static bool warned = false;
+
+ if (do_lint && ! warned) {
+ warned = true;
+ lintwarn(_("FUNCTAB is a gawk extension"));
+ }
r = t2;
} else {
r = *assoc_lookup(t1, t2);
@@ -219,8 +225,16 @@ top:
DEREF(t2);
/* for SYMTAB, step through to the actual variable */
- if (t1 == symbol_table && r->type == Node_var)
- r = r->var_value;
+ if (t1 == symbol_table) {
+ static bool warned = false;
+
+ if (do_lint && ! warned) {
+ warned = true;
+ lintwarn(_("SYMTAB is a gawk extension"));
+ }
+ if (r->type == Node_var)
+ r = r->var_value;
+ }
if (r->type == Node_val)
UPREF(r);
@@ -909,9 +923,13 @@ match_re:
f = lookup(t1->stptr);
}
- if (f == NULL || f->type != Node_func)
- fatal(_("function called indirectly through `%s' does not exist"),
- pc->func_name);
+ if (f == NULL || f->type != Node_func) {
+ if (f->type == Node_ext_func)
+ fatal(_("cannot (yet) call extension functions indirectly"));
+ else
+ fatal(_("function called indirectly through `%s' does not exist"),
+ pc->func_name);
+ }
pc->func_body = f; /* save for next call */
ni = setup_frame(pc);