@@ -53,7 +53,7 @@ impl<'a> TokenTreesReader<'a> {
53
53
token:: OpenDelim ( delim) => buf. push ( self . parse_token_tree_open_delim ( delim) ) ,
54
54
token:: CloseDelim ( delim) => return Err ( self . close_delim_err ( delim) ) ,
55
55
token:: Eof => return Ok ( buf. into_token_stream ( ) ) ,
56
- _ => buf. push ( self . parse_token_tree_other ( ) ) ,
56
+ _ => buf. push ( self . parse_token_tree_non_delim_non_eof ( ) ) ,
57
57
}
58
58
}
59
59
}
@@ -66,11 +66,10 @@ impl<'a> TokenTreesReader<'a> {
66
66
token:: OpenDelim ( delim) => buf. push ( self . parse_token_tree_open_delim ( delim) ) ,
67
67
token:: CloseDelim ( ..) => return buf. into_token_stream ( ) ,
68
68
token:: Eof => {
69
- let mut err = self . eof_err ( ) ;
70
- err. emit ( ) ;
69
+ self . eof_err ( ) . emit ( ) ;
71
70
return buf. into_token_stream ( ) ;
72
71
}
73
- _ => buf. push ( self . parse_token_tree_other ( ) ) ,
72
+ _ => buf. push ( self . parse_token_tree_non_delim_non_eof ( ) ) ,
74
73
}
75
74
}
76
75
}
@@ -245,9 +244,10 @@ impl<'a> TokenTreesReader<'a> {
245
244
}
246
245
247
246
#[ inline]
248
- fn parse_token_tree_other ( & mut self ) -> TokenTree {
249
- // `spacing` for the returned token is determined by the next token:
250
- // its kind and its `preceded_by_whitespace` status.
247
+ fn parse_token_tree_non_delim_non_eof ( & mut self ) -> TokenTree {
248
+ // `this_spacing` for the returned token refers to whether the token is
249
+ // immediately followed by another op token. It is determined by the
250
+ // next token: its kind and its `preceded_by_whitespace` status.
251
251
let ( next_tok, is_next_tok_preceded_by_whitespace) = self . string_reader . next_token ( ) ;
252
252
let this_spacing = if is_next_tok_preceded_by_whitespace || !next_tok. is_op ( ) {
253
253
Spacing :: Alone
0 commit comments