Fix byte offset and error message inconsistencies

This commit is contained in:
Lee Jeffery
2015-05-13 22:05:01 +01:00
parent a76244fcef
commit aef0581513

View File

@@ -406,7 +406,7 @@ impl<'a> StringReader<'a> {
// line comments starting with "///" or "//!" are doc-comments
let doc_comment = self.curr_is('/') || self.curr_is('!');
let start_bpos = self.pos - BytePos(3);
let start_bpos = self.last_pos - BytePos(2);
while !self.is_eof() {
match self.curr.unwrap() {
@@ -415,9 +415,9 @@ impl<'a> StringReader<'a> {
if self.nextch_is('\n') {
// CRLF
break
} else {
} else if doc_comment {
self.err_span_(self.last_pos, self.pos,
"bare CR not allowed in comment");
"bare CR not allowed in doc-comment");
}
}
_ => ()