Skip to content

Commit

Permalink
Improve parsing algorithm to handle spaces and comments #63
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Oct 15, 2021
1 parent e465c6e commit 8001cb5
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,12 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {
resolveGoalsToRun(resolvedGoals)

if ("-d" in Args || "--resolved" in Args) {
printf("Resolved goals to reach for '%s':\n", join(ArgGoals, 0, arrLen(ArgGoals), " ")) # TODO
for (i = 0; i in resolvedGoals; i++) {
printf "Resolved goals to reach for"
for (i = 0; i in ArgGoals; i++)
printf " %s", quote2(ArgGoals[i],1)
print ":"
for (i = 0; i in resolvedGoals; i++)
print " " quote2(resolvedGoals[i])
}
} else {
for (i = 0; i in resolvedGoals; i++) {
goalName = resolvedGoals[i]
Expand Down Expand Up @@ -687,12 +689,6 @@ function quicksortSwap(data, i, j, temp) {
data[i] = data[j]
data[j] = temp
}
function join(arr, startIncl, endExcl, sep, result, i) {
result = arr[startIncl]
for (i = startIncl + 1; i < endExcl; i++)
result = result sep arr[i]
return result
}
function parseCli(line, res, pos,c,last,is_doll,c1) {
for(pos=1;;) {
while((c = substr(line,pos,1))==" " || c == "\t") pos++ # consume spaces
Expand Down

0 comments on commit 8001cb5

Please sign in to comment.