From d03cd3be241d38e6edbe5329a53b276eeaa7528e Mon Sep 17 00:00:00 2001 From: Alexander Shishkin Date: Thu, 25 Feb 2010 17:55:40 +0200 Subject: awk: skip whitespace between array name and subscript It is supported in both mawk and gawk and there are actually scripts out there that use this "flexibility". function old new delta next_token 1144 1152 +8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 8/0) Total: 8 bytes Signed-off-by: Alexander Shishkin Signed-off-by: Denys Vlasenko --- testsuite/awk.tests | 3 +++ 1 file changed, 3 insertions(+) (limited to 'testsuite/awk.tests') diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 7910c8875..03d464969 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -64,4 +64,7 @@ testing "awk string cast (bug 725)" \ "0\nnumber\n" \ "" "" +testing "awk handles whitespace before array subscript" \ + "awk 'BEGIN { arr [3] = 1; print arr [3] }'" "1\n" "" "" + exit $FAILCOUNT -- cgit v1.2.3