Fix whitespace before comments

Looks like whitespace after comments is handled correctly, but not before them.
Yeah, it's because of the way the generator is written where it can't lookahead to see what's coming up next.