Skip to content

Commit

Permalink
Parameterized goals #115 cleanup and remove check that should not now…
Browse files Browse the repository at this point in the history
… happen (determined by code coverage)
  • Loading branch information
xonixx committed Jan 26, 2023
1 parent 6fb3bce commit 0a3fd14
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/parameterized_goals.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Should work as expected. `@doc` should just copy to instantiated goals.
- [x] -l in presence of loop hangs
- [x] check unknown parameterized dep call `@depends_on c @args S`
- [x] all errors at once
- [ ] TODOS
- [x] TODOS
- [ ] validate param name (regex)
- [x] handle + test w/ `@private`
- [x] test w/ `@lib`
Expand Down
19 changes: 8 additions & 11 deletions makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ function prepareArgs( i,arg) {
Options["timing"]
}

function dbgA(name, arr, i,v) { print "--- " name ": "; for (i in arr) { v=arr[i];gsub(SUBSEP,",",i);printf "%6s : %s\n", i, v }}
function dbgAO(name, arr, i) { print "--- " name ": "; for (i=0;i in arr;i++) printf "%2s : %s\n", i, arr[i] }
function indent(ind) {
printf "%" ind*2 "s", ""
}
#function dbgA(name, arr, i,v) { print "--- " name ": "; for (i in arr) { v=arr[i];gsub(SUBSEP,",",i);printf "%6s : %s\n", i, v }}
#function dbgAO(name, arr, i) { print "--- " name ": "; for (i=0;i in arr;i++) printf "%2s : %s\n", i, arr[i] }
#function indent(ind) {
# printf "%" ind*2 "s", ""
#}
#function printDepsTree(goal,ind, i) {
# if (!(goal in GoalsByName)) { die("unknown goal: " goal) }
# indent(ind)
Expand Down Expand Up @@ -361,12 +361,9 @@ function registerReachedIf(goalName, preScript) {
ReachedIf[goalName] = preScript trim($0)
}

function checkBeforeRun( i,j,dep,depCnt,goalName,visited) {
function checkBeforeRun( i,j,dep,depCnt,goalName) {
for (i = 0; i in GoalNames; i++) {
goalName = GoalNames[i]
if (visited[goalName]++)
continue
depCnt = DependenciesCnt[goalName]
depCnt = DependenciesCnt[goalName = GoalNames[i]]
for (j=0; j < depCnt; j++)
if (!((dep = Dependencies[goalName, j]) in GoalsByName))
addError("Goal " quote2(goalName,1) " has unknown dependency '" dep "'", DependenciesLineNo[goalName, j])
Expand Down Expand Up @@ -633,7 +630,7 @@ function instantiateGoals( i,l,goalName) {
delete GoalsByName[goalName]
}
}
function renderArgs(args, s,k) { s = ""; for (k in args) s = s k "=>" args[k] " "; return s }
#function renderArgs(args, s,k) { s = ""; for (k in args) s = s k "=>" args[k] " "; return s }
#
# args: { F => "file1" }
#
Expand Down

0 comments on commit 0a3fd14

Please sign in to comment.