awk: allow empty fuinctions with no arguments, disallow function redefinitions

function                                             old     new   delta
.rodata                                           103681  103700     +19
parse_program                                        303     307      +4
evaluate                                            3145    3141      -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 23/-4)              Total: 19 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2021-06-30 12:23:51 +02:00
parent 86fc2872b3
commit d150710169
2 changed files with 17 additions and 4 deletions

View File

@@ -44,6 +44,16 @@ testing "awk handles empty function f(arg){}" \
"L1\n\nL2\n\n" \
"" ""
prg='
function empty_fun(){}
END {empty_fun()
print "Ok"
}'
testing "awk handles empty function f(){}" \
"awk '$prg'" \
"Ok\n" \
"" ""
prg='
function outer_fun() {
return 1