The current handling of the python actions is quite broken. The self hosted grammarfile parser shows some promise of improving on this (as it understands quite a bit of Python's lexeme structure). At least, instead of splitting at newline and inserting indenation afterwards, lists with logical line strings should be provided. Directly serializing semi-parsed python in the writer would be even better (see the PyBlob class of the self hosted grammar file parser for some ideas, this would also allow cleaner stack var replacement).
The current handling of the python actions is quite broken. The self hosted grammarfile parser shows some promise of improving on this (as it understands quite a bit of Python's lexeme structure). At least, instead of splitting at newline and inserting indenation afterwards, lists with logical line strings should be provided. Directly serializing semi-parsed python in the writer would be even better (see the
PyBlob
class of the self hosted grammar file parser for some ideas, this would also allow cleaner stack var replacement).