I'm a little leary of this.
Right now, Pyke does not parse the python code snippets in the .krb files.
It knows which lines are python code, and just does a simple scan on these
strings looking for pattern variables (indicated by dollar signs, e.g.,
$num). I would like to avoid having Pyke having to fully parse python
code. This would mean staying in sync with changes in the python grammar
and probably would require mechanisms to support multiple grammars somehow
so that Pyke would continue to run on multiple versions of python.
I suppose that the .krb parser could just take all the text up to the next
comma (ignoring commas nested in parens, brackets or within string
literals) as python code and do the same substitution as described above on
it. But then a question arises about single values within parenthesis.
What would ($num + 1) * 3 be when $num is 4? If the parenthesis have
python meaning, it would be 15. But if the parenthesis have Pyke meaning,
they would indicate a singleton tuple that would then be repeated 3 times
giving (5, 5, 5), the same as doing (4 + 1,) * 3 in python.
Any ideas how to deal with this unambiguously?