31.10.2017, 10:59
Idea of pre-preprocessor was discussed a few times. Slice started working on Prawn, but currently it is abandoned I think - https://github.com/oscar-broman/Prawn . As for your examples, you'd have parse to AST as well, so you might get some good ideas from there