Skip to content

Commit cb92f5c

Browse files
committed
Rename StringReader::last_pos as pos.
This is a [breaking-change] for libsyntax.
1 parent 94565a4 commit cb92f5c

File tree

3 files changed

+100
-100
lines changed

3 files changed

+100
-100
lines changed

src/libsyntax/parse/lexer/comments.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn push_blank_line_comment(rdr: &StringReader, comments: &mut Vec<Comment>) {
149149
comments.push(Comment {
150150
style: BlankLine,
151151
lines: Vec::new(),
152-
pos: rdr.last_pos,
152+
pos: rdr.pos,
153153
});
154154
}
155155

@@ -167,7 +167,7 @@ fn read_shebang_comment(rdr: &mut StringReader,
167167
code_to_the_left: bool,
168168
comments: &mut Vec<Comment>) {
169169
debug!(">>> shebang comment");
170-
let p = rdr.last_pos;
170+
let p = rdr.pos;
171171
debug!("<<< shebang comment");
172172
comments.push(Comment {
173173
style: if code_to_the_left { Trailing } else { Isolated },
@@ -180,7 +180,7 @@ fn read_line_comments(rdr: &mut StringReader,
180180
code_to_the_left: bool,
181181
comments: &mut Vec<Comment>) {
182182
debug!(">>> line comments");
183-
let p = rdr.last_pos;
183+
let p = rdr.pos;
184184
let mut lines: Vec<String> = Vec::new();
185185
while rdr.curr_is('/') && rdr.nextch_is('/') {
186186
let line = rdr.read_one_line_comment();
@@ -240,7 +240,7 @@ fn read_block_comment(rdr: &mut StringReader,
240240
code_to_the_left: bool,
241241
comments: &mut Vec<Comment>) {
242242
debug!(">>> block comment");
243-
let p = rdr.last_pos;
243+
let p = rdr.pos;
244244
let mut lines: Vec<String> = Vec::new();
245245
let col = rdr.col;
246246
rdr.bump();
@@ -369,7 +369,7 @@ pub fn gather_comments_and_literals(span_diagnostic: &errors::Handler,
369369
}
370370

371371

372-
let bstart = rdr.last_pos;
372+
let bstart = rdr.pos;
373373
rdr.next_token();
374374
// discard, and look ahead; we're working with internal state
375375
let TokenAndSpan { tok, sp } = rdr.peek();

0 commit comments

Comments
 (0)