From 2a3164afb1306038becb6799f79e525aec206aaa Mon Sep 17 00:00:00 2001 From: xonix Date: Thu, 19 Jan 2023 01:34:06 +0200 Subject: [PATCH] Parameterized goals #115 --- makesure.awk | 9 +++++++-- tests/27_parameterized_goals.sh | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 tests/27_parameterized_goals.sh diff --git a/makesure.awk b/makesure.awk index 093d532..d425936 100755 --- a/makesure.awk +++ b/makesure.awk @@ -5,19 +5,24 @@ BEGIN { SupportedOptions["tracing"] SupportedOptions["silent"] SupportedOptions["timing"] - split("",Lines) + split("",Lines)# line no. -> line split("",Args) # parsed CLI args split("",ArgGoals) # invoked goals split("",Options) split("",GoalNames) # list split("",GoalsByName) # name -> private + split("",GoalParamsCnt) # name -> params cnt + split("",GoalParams) # name,paramI -> param name split("",CodePre) # name -> pre-body (should also go before lib) split("",Code) # name -> body split("",DefineOverrides) # k -> "" DefinesCode="" split("",Dependencies) # name,i -> dep goal split("",DependenciesLineNo) # name,i -> line no. - split("",DependenciesCnt) # name -> dep cnd + split("",DependenciesCnt) # name -> dep cnt + split("",DependencyArgsCnt) # name,i -> args cnt + split("",DependencyArgs) # name,depI,argI -> val + split("",DependencyArgsType) # name,depI,argI -> string|var split("",Doc) # name -> doc str split("",ReachedIf) # name -> condition line GlobCnt = 0 # count of files for glob diff --git a/tests/27_parameterized_goals.sh b/tests/27_parameterized_goals.sh new file mode 100644 index 0000000..9d55abe --- /dev/null +++ b/tests/27_parameterized_goals.sh @@ -0,0 +1,6 @@ + +@goal a +@depends_on b @args 'hello' + +@goal b @params S + echo "$S world"