xonixx/makesure

Support interpolation including parameterized goal params

xonixx opened this issue · 0 comments

xonixx commented

We need to be able to do this:

@define H 'hello'

@goal g
@depends_on pg @args 'world'

@goal pg @params W
@depends_on pg1 @args "$H $W" # now doesn't work, because here W is not interpolated properly, thus is empty

@goal pg1 @params V
  echo "$V"

So this outputs hello instead of the desired hello world.

This happens because we apply interpolation as we parse, but parameterized goals (PG) processing happens at the end, after all lines parsed.

Thus the solution would be to defer those @depends_on pg1 @args "$H $W" re-parsing by moving it into the PG instantiation logic.