Skip to content

Commit

Permalink
Release 0.9.22 #157
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Jan 6, 2024
1 parent 6656865 commit b291c60
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
15 changes: 9 additions & 6 deletions makesure
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function handleDoc(i){
registerDoc(globGoal(i))}}
function registerDoc(goalName){
if(goalName in Doc)
addError("Multiple "$1" not allowed for a goal")
addError("Multiple @doc not allowed for a goal")
$1=""
Doc[goalName]=trim($0)}
function handleDependsOn(i){
Expand Down Expand Up @@ -251,7 +251,7 @@ function makeGlobVarsCode(i){
return"ITEM="quoteArg(GlobFiles[i])";INDEX="i";TOTAL="GlobCnt";"}
function registerReachedIf(goalName,preScript){
if(goalName in ReachedIf)
addError("Multiple "$1" not allowed for a goal")
addError("Multiple @reached_if not allowed for a goal")
trimDirective()
ReachedIf[goalName]=preScript trim($0)}
function trimDirective(){
Expand Down Expand Up @@ -361,8 +361,11 @@ function currentGoalName(){return arrLast(GoalNames)}
function currentLibName(){return arrLast(LibNames)}
function realExit(code){
exit code}
function addError(err,n){if(!n)n=NR;Error=addL(Error,err":\n"ARGV[1]":"n": "Lines[n])}
function addErrorDedup(err,n){if((err,n)in AddedErrors)return;AddedErrors[err,n];addError(err,n)}
function addError(err,n){
if((err,n?n:(n=NR))in AddedErrors)
return
AddedErrors[err,n]
Error=addL(Error,err":\n"ARGV[1]":"n": "Lines[n])}
function die(msg,out){
out="cat 1>&2"
print msg|out
Expand Down Expand Up @@ -463,7 +466,7 @@ function instantiate(goal,args,newArgs,i,j,depArg,depArgType,dep,goalNameInstant
parseCli_2(DependencyArgsL[gi],args,Vars,reparsed)
argsCnt=reparsed[-7]-3}
if(dep in GoalsByName&&argsCnt!=GoalParamsCnt[dep])
addErrorDedup("wrong args count for '\''"dep"'\''",DependenciesLineNo[gi])
addError("wrong args count for '\''"dep"'\''",DependenciesLineNo[gi])
for(j=0;j<argsCnt;j++){
depArg=reparsed[j+3]
depArgType="u"==reparsed[j+3,"quote"]?"var":"str"
Expand All @@ -472,7 +475,7 @@ function instantiate(goal,args,newArgs,i,j,depArg,depArgType,dep,goalNameInstant
depArg : \
depArgType=="var"?\
(depArg in args?args[depArg]:\
depArg in Vars?Vars[depArg]:addErrorDedup("wrong arg '\''"depArg"'\''",DependenciesLineNo[gi])):\
depArg in Vars?Vars[depArg]:addError("wrong arg '\''"depArg"'\''",DependenciesLineNo[gi])):\
die("wrong depArgType: "depArgType)}
gii=goalNameInstantiated SUBSEP i
Dependencies[gii]=instantiate(dep,newArgs)
Expand Down
15 changes: 9 additions & 6 deletions makesure_candidate
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function handleDoc(i){
registerDoc(globGoal(i))}}
function registerDoc(goalName){
if(goalName in Doc)
addError("Multiple "$1" not allowed for a goal")
addError("Multiple @doc not allowed for a goal")
$1=""
Doc[goalName]=trim($0)}
function handleDependsOn(i){
Expand Down Expand Up @@ -251,7 +251,7 @@ function makeGlobVarsCode(i){
return"ITEM="quoteArg(GlobFiles[i])";INDEX="i";TOTAL="GlobCnt";"}
function registerReachedIf(goalName,preScript){
if(goalName in ReachedIf)
addError("Multiple "$1" not allowed for a goal")
addError("Multiple @reached_if not allowed for a goal")
trimDirective()
ReachedIf[goalName]=preScript trim($0)}
function trimDirective(){
Expand Down Expand Up @@ -361,8 +361,11 @@ function currentGoalName(){return arrLast(GoalNames)}
function currentLibName(){return arrLast(LibNames)}
function realExit(code){
exit code}
function addError(err,n){if(!n)n=NR;Error=addL(Error,err":\n"ARGV[1]":"n": "Lines[n])}
function addErrorDedup(err,n){if((err,n)in AddedErrors)return;AddedErrors[err,n];addError(err,n)}
function addError(err,n){
if((err,n?n:(n=NR))in AddedErrors)
return
AddedErrors[err,n]
Error=addL(Error,err":\n"ARGV[1]":"n": "Lines[n])}
function die(msg,out){
out="cat 1>&2"
print msg|out
Expand Down Expand Up @@ -463,7 +466,7 @@ function instantiate(goal,args,newArgs,i,j,depArg,depArgType,dep,goalNameInstant
parseCli_2(DependencyArgsL[gi],args,Vars,reparsed)
argsCnt=reparsed[-7]-3}
if(dep in GoalsByName&&argsCnt!=GoalParamsCnt[dep])
addErrorDedup("wrong args count for '\''"dep"'\''",DependenciesLineNo[gi])
addError("wrong args count for '\''"dep"'\''",DependenciesLineNo[gi])
for(j=0;j<argsCnt;j++){
depArg=reparsed[j+3]
depArgType="u"==reparsed[j+3,"quote"]?"var":"str"
Expand All @@ -472,7 +475,7 @@ function instantiate(goal,args,newArgs,i,j,depArg,depArgType,dep,goalNameInstant
depArg : \
depArgType=="var"?\
(depArg in args?args[depArg]:\
depArg in Vars?Vars[depArg]:addErrorDedup("wrong arg '\''"depArg"'\''",DependenciesLineNo[gi])):\
depArg in Vars?Vars[depArg]:addError("wrong arg '\''"depArg"'\''",DependenciesLineNo[gi])):\
die("wrong depArgType: "depArgType)}
gii=goalNameInstantiated SUBSEP i
Dependencies[gii]=instantiate(dep,newArgs)
Expand Down

0 comments on commit b291c60

Please sign in to comment.