Skip to content

Commit

Permalink
Parameterized goals #115
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Jan 26, 2023
1 parent 61a2b9e commit 175fb1f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function handleGoal( i,goalName) {
} else if (NF > 2) addError("nothing allowed after goal name")
}

function registerGoal(priv, goalName, i) { # -> 1 if no errors, otherwise 0
function registerGoal(priv, goalName) { # -> 1 if no errors, otherwise 0
if ("" == goalName || "@params" == goalName)
addError("Goal must have a name")
else if (goalName in GoalsByName)
Expand Down Expand Up @@ -395,7 +395,7 @@ body,goalBody,goalBodies,resolvedGoals,exitCode, t0,t1,t2, goalTimed, list) {

# First do topological sort disregarding @reached_if to catch loops.
# We need to do it before instantiate, because instantiation is recursive and will hang in presence of loop.
topologicalSort(0,GoalNames)
if (arrLen(GoalNames)) topologicalSort(0,GoalNames)

instantiateGoals()

Expand Down
Empty file added tests/1_empty.sh
Empty file.
3 changes: 3 additions & 0 deletions tests/1_goals.tush
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals_multi_reached_if.sh
@ Multiple @reached_if not allowed for a goal:
@ tests/1_goals_multi_reached_if.sh:4: @reached_if false
? 1

$ cd "$MYDIR"; ./$MAKESURE -f tests/1_empty.sh -l
| Available goals:

0 comments on commit 175fb1f

Please sign in to comment.