Skip to content

Commit 43f72e1

Browse files
committed
---
yaml --- r: 118630 b: refs/heads/try c: 8de2618 h: refs/heads/master v: v3
1 parent ac4b84a commit 43f72e1

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b1646cbfd908dc948b251e362669af421100647a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d6736a1440d42f6af967a8a20ab8d73522112b72
5-
refs/heads/try: 612bbaf7a07fe247e5e2d057cc4f10742918ead0
5+
refs/heads/try: 8de2618182f14bb2245e8e89f171aaf9b2f29690
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libsyntax/parse/lexer/mod.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,9 @@ impl<'a> StringReader<'a> {
906906
// Byte offsetting here is okay because the
907907
// character before position `start` are an
908908
// ascii single quote and ascii 'b'.
909+
let last_pos = self_.last_pos;
909910
self_.fatal_span_verbose(
910-
start - BytePos(2), self_.last_pos,
911+
start - BytePos(2), last_pos,
911912
"unterminated byte constant".to_string());
912913
}
913914
self_.bump(); // advance curr past token
@@ -920,7 +921,8 @@ impl<'a> StringReader<'a> {
920921
let mut value = Vec::new();
921922
while !self_.curr_is('"') {
922923
if self_.is_eof() {
923-
self_.fatal_span(start, self_.last_pos,
924+
let last_pos = self_.last_pos;
925+
self_.fatal_span(start, last_pos,
924926
"unterminated double quote byte string");
925927
}
926928

@@ -944,20 +946,25 @@ impl<'a> StringReader<'a> {
944946
}
945947

946948
if self_.is_eof() {
947-
self_.fatal_span(start_bpos, self_.last_pos, "unterminated raw string");
949+
let last_pos = self_.last_pos;
950+
self_.fatal_span(start_bpos, last_pos, "unterminated raw string");
948951
} else if !self_.curr_is('"') {
949-
self_.fatal_span_char(start_bpos, self_.last_pos,
952+
let last_pos = self_.last_pos;
953+
let ch = self_.curr.unwrap();
954+
self_.fatal_span_char(start_bpos, last_pos,
950955
"only `#` is allowed in raw string delimitation; \
951956
found illegal character",
952-
self_.curr.unwrap());
957+
ch);
953958
}
954959
self_.bump();
955960
let content_start_bpos = self_.last_pos;
956961
let mut content_end_bpos;
957962
'outer: loop {
958963
match self_.curr {
959-
None => self_.fatal_span(start_bpos, self_.last_pos,
960-
"unterminated raw string"),
964+
None => {
965+
let last_pos = self_.last_pos;
966+
self_.fatal_span(start_bpos, last_pos, "unterminated raw string")
967+
},
961968
Some('"') => {
962969
content_end_bpos = self_.last_pos;
963970
for _ in range(0, hash_count) {
@@ -969,8 +976,9 @@ impl<'a> StringReader<'a> {
969976
break;
970977
},
971978
Some(c) => if c > '\x7F' {
972-
self_.err_span_char(self_.last_pos, self_.last_pos,
973-
"raw byte string must be ASCII", c);
979+
let last_pos = self_.last_pos;
980+
self_.err_span_char(
981+
last_pos, last_pos, "raw byte string must be ASCII", c);
974982
}
975983
}
976984
self_.bump();

0 commit comments

Comments
 (0)