Skip to content

Commit

Permalink
Parameterized goals #115 rfct
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Jan 21, 2023
1 parent 03f1749 commit 4781066
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {

checkBeforeRun()

dbgA("GoalParamsCnt",GoalParamsCnt)
dbgA("GoalParams",GoalParams)
dbgA("DependencyArgsCnt",DependencyArgsCnt)
dbgA("DependencyArgs",DependencyArgs)
dbgA("DependencyArgsType",DependencyArgsType)
# dbgA("GoalParamsCnt",GoalParamsCnt)
# dbgA("GoalParams",GoalParams)
# dbgA("DependencyArgsCnt",DependencyArgsCnt)
# dbgA("DependencyArgs",DependencyArgs)
# dbgA("DependencyArgsType",DependencyArgsType)

if (Error)
die(Error)
Expand Down Expand Up @@ -415,21 +415,16 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {

instantiateGoals()

printDepsTree("a")
# printDepsTree("a")

topologicalSort(1,ArgGoals,resolvedGoals,reachedGoals) # now do topological sort including @reached_if to resolve goals to run

printDepsTree("a")
# printDepsTree("a")

preludeCode = getPreludeCode()

# TODO looks like this loop should go inside else branch below
for (i = 0; i in GoalNames; i++) {
goalName = GoalNames[i]

body = trim(Code[goalName])

emptyGoals[goalName] = body == ""
emptyGoals[goalName] = "" == (body = trim(Code[goalName = GoalNames[i]]))

goalBody[0] = ""
addLine(goalBody, preludeCode)
Expand Down Expand Up @@ -628,7 +623,7 @@ function copyKey(keySrc,keyDst,arr) { if (keySrc in arr) arr[keyDst] = arr[keySr
# args: { F => "file1" }
#
function instantiate(goal,args,newArgs, i,j,depArg,depArgType,dep,goalNameInstantiated,argsCnt) { # -> goalNameInstantiated
print ">instantiating " goal " { " renderArgs(args) "} ..."
# print ">instantiating " goal " { " renderArgs(args) "} ..."

if (!(goal in GoalsByName)) { die("unknown goal: " goal) }

Expand Down

0 comments on commit 4781066

Please sign in to comment.