The string representation of parameter values are used instead of trying to access the value attribute that only works for Literals.
The regex used to find parameters is modified because the previous expression would only match one parameter substitution. If multiple were present, it would match one incorrect string. For example, if your template was {$this} does not have value {$value}, the regular expression would match $this} does not have value {$value instead of $this and $value. Note that the regex is still a bit fragile if whitespace is involved.
A test is also added to verify both these issues are resolved.
Looks great. Thank you for the detailed issue report and clean PR with tests. Don't worry about the failing CI tests, I am working on that docker/poetry/pyducktape compilation issue.
This fixes #199. It includes two changes:
value
attribute that only works for Literals.{$this} does not have value {$value}
, the regular expression would match$this} does not have value {$value
instead of$this
and$value
. Note that the regex is still a bit fragile if whitespace is involved.A test is also added to verify both these issues are resolved.