From dbdf64661cd5e3e671d1d2d99be118e6c0416df7 Mon Sep 17 00:00:00 2001 From: xonix Date: Fri, 27 Jan 2023 01:19:40 +0200 Subject: [PATCH] Parameterized goals #115 attempt fixing tests macos 10.15 awk version 20070501 --- makesure.awk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/makesure.awk b/makesure.awk index 0a673f8..6a7a116 100755 --- a/makesure.awk +++ b/makesure.awk @@ -41,7 +41,7 @@ BEGIN { makesure() } -function makesure() { +function makesure( i) { while (getline > 0) { Lines[NR]=$0 if ($1 ~ /^@/ && "@define" != $1 && "@reached_if" != $1) reparseCli() @@ -56,6 +56,7 @@ function makesure() { else if ("@use_lib" == $1) handleUseLib() else if ($1 ~ /^@/) addError("Unknown directive: " $1) else handleCodeLine($0) + for (i=1;i<10;i++) $i="" } doWork() realExit(0) @@ -857,11 +858,13 @@ function reparseCli( res,i,err) { if (err) { addError("Syntax error: " err) die(Error) - } else + } else { + $0="" for (i=NF=0; i in res; i++) { $(++NF)=res[i] Quotes[NF]=res[i,"quote"] } + } } function quote2(s,force) { if (index(s,"'")) {