From b1bd29c2e19ede4944ad5baef9fc328c28902cea Mon Sep 17 00:00:00 2001 From: xonix Date: Sat, 24 Feb 2024 18:49:44 +0200 Subject: [PATCH] Allow glob to be interpolated string to facilitate reuse #165 --- makesure_candidate | 6 ++++-- minify.awk | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/makesure_candidate b/makesure_candidate index 8518aba..5813d2f 100755 --- a/makesure_candidate +++ b/makesure_candidate @@ -180,7 +180,7 @@ function handleGoalGlob(goalName,globAllGoal,globSingle,priv,i,pattern,nfMax,gi, }else pattern=$(nfMax=4) if(NF>nfMax&&"@params"!=$(nfMax+1)) - addError("nothing or @params allowed after glob pattern") + addError("nothing or @params allowed after glob pattern") else if(pattern=="") addError("absent glob pattern") else { @@ -639,7 +639,9 @@ function reparseCli(res,i,err){ for(i=NF=0;i in res;i++) $(++NF)=res[i] for(i=2;i<=NF;i++) - if("\""==res[i-1,"quote"]&&!("@define"==$1&&3==i||"@depends_on"==$1&&"@args"==$3&&i>3)){ + if("\""==res[i-1,"quote"]&&!("@define"==$1&&3==i|| +"@depends_on"==$1&&"@args"==$3&&i>3|| +"@goal"==$1&&"@glob"==$(i-1))){ addError("Wrong quoting: "$i) return 0} return 1} diff --git a/minify.awk b/minify.awk index b88bfed..96a3c68 100644 --- a/minify.awk +++ b/minify.awk @@ -21,7 +21,7 @@ function minifyLine( l,subs) { gsub(/ \/ /, "/") gsub(/ \* /, "*") gsub(/ \+ /, "+") - gsub(/ \|\| /, "||") + gsub(/ \|\| */, "||") gsub(/ \| /, "|") if (/ \? /) gsub(/ : /, ":") gsub(/ \? /, "?")