Open jonocarroll opened 2 months ago
Sorry for commenting on this so late!
The reason for the (too) numerous line breaks is partially an issue I have in parser #29 which I will look into soon.
I did some thinking about the transpiler and realise we would just need to add indentation \t
when we enclose an environment. I think we can already get much cleaner code.
Feel free to ignore this - I just wanted to play around with it and see if I could fix a very minor annoyance.
With this toy vapour code
I get this result
vapour@0.0.5
With the minor changes in this PR, I get
vapour@0.0.6
return()
I have not tested what else this changes or if this is even the right place to make these changes. Actually, I'm fairly sure it's not for the extra newline; it happens for other functions containing expressions, too.
One option would be to style the generated R file with e.g. {styler} which would take care of any inconsistencies from transpilation, e.g. dealing with indentation which sounds like a whole world of trouble. Running
styler::style_file("R/vapour.R")
over the file generated by vapour@0.0.5 produceswhich appears to have fixed both issues.