Explicitly ignore \r in comments.

'.' matches any char except newline, \r is part of newline on certain platforms
Fix bug in nested comment code.
Fix formatting