Allow bare CR in ////-style comment.

This commit is contained in:
Masaki Hara
2017-05-08 22:29:24 +09:00
parent 70198a0a44
commit 0e8e45c740
3 changed files with 25 additions and 1 deletions

View File

@@ -504,7 +504,7 @@ impl<'a> StringReader<'a> {
self.bump();
// line comments starting with "///" or "//!" are doc-comments
let doc_comment = self.ch_is('/') || self.ch_is('!');
let doc_comment = (self.ch_is('/') && !self.nextch_is('/')) || self.ch_is('!');
let start_bpos = self.pos - BytePos(2);
while !self.is_eof() {