Open jaswrks opened 9 years ago
I think I had initially hoped to do something like this, but unfortunately the CS tokenizer gobbles up a lot of the non-significant white-space, and without a white-space and newline token it's not easily recreated. Originally I had added a newline token and was able to preserve some of the line spacing, but the inclusion of the new token was messing up the tokenizer's parsing in some situations...
I'm a bit backed up at the moment, but if you want to take a look at this problem, I'll accept a pull request.
With v0.10.0 all the existing blank lines are now kept. I've written a new Coffeescript parser that preserves this line information so that the original source is unambiguously reconstructable. Is this something we still want to look at doing?
It would be really helpful if there were an option
--keep-blank-lines=1
; i.e., making it possible to keep X number of blank lines if desirable. I'd suggest a default value of1
blank line is allowed.