commit 3c2f362b69688911b90b25c698b65713b544ae0f
parent 3343173a9156547a3043b93388798a8a81bf086d
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Thu, 7 Jan 2016 15:13:23 +0100
error out on undefined tables
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/data.awk b/data.awk
@@ -75,6 +75,17 @@ state == 1 {
}
function loop_start(varname, prefix, depth) {
+ if(!((varname, "fields") in V)) {
+ if(ENVIRON["DATA_AWK_EMPTY_GET"]) {
+ if(DEBUG) {
+ print "table not found: " varname >"/dev/stderr"
+ }
+ found = ""
+ } else {
+ print "error: undefined table '"varname"'" >"/dev/stderr"
+ exit 1
+ }
+ }
depth = ++loop_stack["depth"]
loop_stack[depth,"row"] = 0
loop_stack[depth,"var"] = varname