awk: evaluate all, even superfluous function args

function                                             old     new   delta
evaluate                                            3128    3135      +7

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2021-06-30 12:52:51 +02:00
parent ca9278ee58
commit d7354df169
2 changed files with 19 additions and 8 deletions

View File

@@ -87,11 +87,17 @@ BEGIN {
a=2
print v (a)
}'
testing "'v (a)' is not a function call, it is a concatenation" \
testing "awk 'v (a)' is not a function call, it is a concatenation" \
"awk '$prg' 2>&1" \
"12\n" \
"" ""
prg='func f(){print"F"};func g(){print"G"};BEGIN{f(g(),g())}'
testing "awk unused function args are evaluated" \
"awk '$prg' 2>&1" \
"G\nG\nF\n" \
"" ""
optional DESKTOP
testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4294967295\n" "" "\n"