@@ -154,8 +154,8 @@ fn push_blank_line_comment(rdr: &StringReader, comments: &mut Vec<Comment>) {
154
154
}
155
155
156
156
fn consume_whitespace_counting_blank_lines ( rdr : & mut StringReader , comments : & mut Vec < Comment > ) {
157
- while is_pattern_whitespace ( rdr. curr ) && !rdr. is_eof ( ) {
158
- if rdr. col == CharPos ( 0 ) && rdr. curr_is ( '\n' ) {
157
+ while is_pattern_whitespace ( rdr. ch ) && !rdr. is_eof ( ) {
158
+ if rdr. col == CharPos ( 0 ) && rdr. ch_is ( '\n' ) {
159
159
push_blank_line_comment ( rdr, & mut * comments) ;
160
160
}
161
161
rdr. bump ( ) ;
@@ -182,7 +182,7 @@ fn read_line_comments(rdr: &mut StringReader,
182
182
debug ! ( ">>> line comments" ) ;
183
183
let p = rdr. pos ;
184
184
let mut lines: Vec < String > = Vec :: new ( ) ;
185
- while rdr. curr_is ( '/' ) && rdr. nextch_is ( '/' ) {
185
+ while rdr. ch_is ( '/' ) && rdr. nextch_is ( '/' ) {
186
186
let line = rdr. read_one_line_comment ( ) ;
187
187
debug ! ( "{}" , line) ;
188
188
// Doc comments are not put in comments.
@@ -249,9 +249,9 @@ fn read_block_comment(rdr: &mut StringReader,
249
249
let mut curr_line = String :: from ( "/*" ) ;
250
250
251
251
// doc-comments are not really comments, they are attributes
252
- if ( rdr. curr_is ( '*' ) && !rdr. nextch_is ( '*' ) ) || rdr. curr_is ( '!' ) {
253
- while !( rdr. curr_is ( '*' ) && rdr. nextch_is ( '/' ) ) && !rdr. is_eof ( ) {
254
- curr_line. push ( rdr. curr . unwrap ( ) ) ;
252
+ if ( rdr. ch_is ( '*' ) && !rdr. nextch_is ( '*' ) ) || rdr. ch_is ( '!' ) {
253
+ while !( rdr. ch_is ( '*' ) && rdr. nextch_is ( '/' ) ) && !rdr. is_eof ( ) {
254
+ curr_line. push ( rdr. ch . unwrap ( ) ) ;
255
255
rdr. bump ( ) ;
256
256
}
257
257
if !rdr. is_eof ( ) {
@@ -271,19 +271,19 @@ fn read_block_comment(rdr: &mut StringReader,
271
271
if rdr. is_eof ( ) {
272
272
panic ! ( rdr. fatal( "unterminated block comment" ) ) ;
273
273
}
274
- if rdr. curr_is ( '\n' ) {
274
+ if rdr. ch_is ( '\n' ) {
275
275
trim_whitespace_prefix_and_push_line ( & mut lines, curr_line, col) ;
276
276
curr_line = String :: new ( ) ;
277
277
rdr. bump ( ) ;
278
278
} else {
279
- curr_line. push ( rdr. curr . unwrap ( ) ) ;
280
- if rdr. curr_is ( '/' ) && rdr. nextch_is ( '*' ) {
279
+ curr_line. push ( rdr. ch . unwrap ( ) ) ;
280
+ if rdr. ch_is ( '/' ) && rdr. nextch_is ( '*' ) {
281
281
rdr. bump ( ) ;
282
282
rdr. bump ( ) ;
283
283
curr_line. push ( '*' ) ;
284
284
level += 1 ;
285
285
} else {
286
- if rdr. curr_is ( '*' ) && rdr. nextch_is ( '/' ) {
286
+ if rdr. ch_is ( '*' ) && rdr. nextch_is ( '/' ) {
287
287
rdr. bump ( ) ;
288
288
rdr. bump ( ) ;
289
289
curr_line. push ( '/' ) ;
@@ -305,7 +305,7 @@ fn read_block_comment(rdr: &mut StringReader,
305
305
Isolated
306
306
} ;
307
307
rdr. consume_non_eol_whitespace ( ) ;
308
- if !rdr. is_eof ( ) && !rdr. curr_is ( '\n' ) && lines. len ( ) == 1 {
308
+ if !rdr. is_eof ( ) && !rdr. ch_is ( '\n' ) && lines. len ( ) == 1 {
309
309
style = Mixed ;
310
310
}
311
311
debug ! ( "<<< block comment" ) ;
@@ -319,11 +319,11 @@ fn read_block_comment(rdr: &mut StringReader,
319
319
320
320
fn consume_comment ( rdr : & mut StringReader , code_to_the_left : bool , comments : & mut Vec < Comment > ) {
321
321
debug ! ( ">>> consume comment" ) ;
322
- if rdr. curr_is ( '/' ) && rdr. nextch_is ( '/' ) {
322
+ if rdr. ch_is ( '/' ) && rdr. nextch_is ( '/' ) {
323
323
read_line_comments ( rdr, code_to_the_left, comments) ;
324
- } else if rdr. curr_is ( '/' ) && rdr. nextch_is ( '*' ) {
324
+ } else if rdr. ch_is ( '/' ) && rdr. nextch_is ( '*' ) {
325
325
read_block_comment ( rdr, code_to_the_left, comments) ;
326
- } else if rdr. curr_is ( '#' ) && rdr. nextch_is ( '!' ) {
326
+ } else if rdr. ch_is ( '#' ) && rdr. nextch_is ( '!' ) {
327
327
read_shebang_comment ( rdr, code_to_the_left, comments) ;
328
328
} else {
329
329
panic ! ( ) ;
@@ -357,7 +357,7 @@ pub fn gather_comments_and_literals(span_diagnostic: &errors::Handler,
357
357
loop {
358
358
let mut code_to_the_left = !first_read;
359
359
rdr. consume_non_eol_whitespace ( ) ;
360
- if rdr. curr_is ( '\n' ) {
360
+ if rdr. ch_is ( '\n' ) {
361
361
code_to_the_left = false ;
362
362
consume_whitespace_counting_blank_lines ( & mut rdr, & mut comments) ;
363
363
}
0 commit comments