=== modified file 'aat_data.test' --- aat_data.test 2016-01-07 15:19:29 +0000 +++ aat_data.test 2015-10-22 23:30:06 +0000 @@ -54,7 +54,7 @@ |} --- >>> /Makefile:.*failed/ ->>>2 /error: undefined scalar 'name'/ +>>>2 /error: undefined variable 'name'/ >>>= 2 ./aattest tests/data6 @@ -132,36 +132,3 @@ ] >>>2 >>>= 0 - -./aattest tests/data8 -<<< -@awk ../../data.awk -|END{ -@for n in names -Hello {}! -@endfor -|} ---- -names=[ -name -X -Y -] ->>> -Hello X! -Hello Y! ->>>2 ->>>= 0 - -./aattest tests/data9 -<<< -@awk ../../data.awk -|END{ -@for n in names -Hello {}! -@endfor -|} ---- ->>> /Makefile:.*failed/ ->>>2 /error: undefined table 'names'/ ->>>= 2 === modified file 'data.awk' --- data.awk 2016-01-07 15:19:29 +0000 +++ data.awk 2016-01-07 14:13:23 +0000 @@ -74,20 +74,17 @@ exit 1 } -function data_not_found_error(varname, type) { - if(ENVIRON["DATA_AWK_EMPTY_GET"]) { - if(DEBUG) { - print type" not found: " varname >"/dev/stderr" - } - } else { - print "error: undefined "type" '"varname"'" >"/dev/stderr" - exit 1 - } -} - function loop_start(varname, prefix, depth) { if(!((varname, "fields") in V)) { - data_not_found_error(varname, "table") + 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 @@ -162,8 +159,15 @@ function get(varname) { if(!find(varname)) { - data_not_found_error(varname, "scalar") - found = "" + if(ENVIRON["DATA_AWK_EMPTY_GET"]) { + if(DEBUG) { + print "variable not found: " varname >"/dev/stderr" + } + found = "" + } else { + print "error: undefined variable '"varname"'" >"/dev/stderr" + exit 1 + } } if(DEBUG) { print "get →" varname "← = →"found"←" >"/dev/stderr"