@@ -143,7 +143,7 @@ pub struct Parser<'a> {
143143 pub prev_token : Token ,
144144 pub capture_cfg : bool ,
145145 restrictions : Restrictions ,
146- expected_tokens : Vec < TokenType > ,
146+ expected_token_types : Vec < TokenType > ,
147147 token_cursor : TokenCursor ,
148148 // The number of calls to `bump`, i.e. the position in the token stream.
149149 num_bump_calls : u32 ,
@@ -464,7 +464,7 @@ impl<'a> Parser<'a> {
464464 prev_token : Token :: dummy ( ) ,
465465 capture_cfg : false ,
466466 restrictions : Restrictions :: empty ( ) ,
467- expected_tokens : Vec :: new ( ) ,
467+ expected_token_types : Vec :: new ( ) ,
468468 token_cursor : TokenCursor { tree_cursor : stream. into_trees ( ) , stack : Vec :: new ( ) } ,
469469 num_bump_calls : 0 ,
470470 break_last_token : 0 ,
@@ -528,7 +528,7 @@ impl<'a> Parser<'a> {
528528
529529 /// Expects and consumes the token `t`. Signals an error if the next token is not `t`.
530530 pub fn expect ( & mut self , t : & TokenKind ) -> PResult < ' a , Recovered > {
531- if self . expected_tokens . is_empty ( ) {
531+ if self . expected_token_types . is_empty ( ) {
532532 if self . token == * t {
533533 self . bump ( ) ;
534534 Ok ( Recovered :: No )
@@ -593,13 +593,13 @@ impl<'a> Parser<'a> {
593593
594594 /// Checks if the next token is `tok`, and returns `true` if so.
595595 ///
596- /// This method will automatically add `tok` to `expected_tokens ` if `tok` is not
596+ /// This method will automatically add `tok` to `expected_token_types ` if `tok` is not
597597 /// encountered.
598598 #[ inline]
599599 fn check ( & mut self , tok : & TokenKind ) -> bool {
600600 let is_present = self . token == * tok;
601601 if !is_present {
602- self . expected_tokens . push ( TokenType :: Token ( tok. clone ( ) ) ) ;
602+ self . expected_token_types . push ( TokenType :: Token ( tok. clone ( ) ) ) ;
603603 }
604604 is_present
605605 }
@@ -640,7 +640,7 @@ impl<'a> Parser<'a> {
640640 #[ inline]
641641 #[ must_use]
642642 fn check_keyword ( & mut self , kw : Symbol ) -> bool {
643- self . expected_tokens . push ( TokenType :: Keyword ( kw) ) ;
643+ self . expected_token_types . push ( TokenType :: Keyword ( kw) ) ;
644644 self . token . is_keyword ( kw)
645645 }
646646
@@ -729,7 +729,7 @@ impl<'a> Parser<'a> {
729729 if ok {
730730 true
731731 } else {
732- self . expected_tokens . push ( typ) ;
732+ self . expected_token_types . push ( typ) ;
733733 false
734734 }
735735 }
@@ -806,7 +806,7 @@ impl<'a> Parser<'a> {
806806 true
807807 }
808808 _ => {
809- self . expected_tokens . push ( TokenType :: Token ( expected) ) ;
809+ self . expected_token_types . push ( TokenType :: Token ( expected) ) ;
810810 false
811811 }
812812 }
@@ -1154,7 +1154,7 @@ impl<'a> Parser<'a> {
11541154 self . token_spacing = next_spacing;
11551155
11561156 // Diagnostics.
1157- self . expected_tokens . clear ( ) ;
1157+ self . expected_token_types . clear ( ) ;
11581158 }
11591159
11601160 /// Advance the parser by one token.
@@ -1642,8 +1642,8 @@ impl<'a> Parser<'a> {
16421642 DebugParser { parser : self , lookahead }
16431643 }
16441644
1645- pub fn clear_expected_tokens ( & mut self ) {
1646- self . expected_tokens . clear ( ) ;
1645+ pub fn clear_expected_token_types ( & mut self ) {
1646+ self . expected_token_types . clear ( ) ;
16471647 }
16481648
16491649 pub fn approx_token_stream_pos ( & self ) -> u32 {
0 commit comments