@@ -141,7 +141,7 @@ pub struct Parser<'a> {
141141 pub prev_token : Token ,
142142 pub capture_cfg : bool ,
143143 restrictions : Restrictions ,
144- expected_tokens : Vec < TokenType > ,
144+ expected_token_types : Vec < TokenType > ,
145145 token_cursor : TokenCursor ,
146146 // The number of calls to `bump`, i.e. the position in the token stream.
147147 num_bump_calls : u32 ,
@@ -490,7 +490,7 @@ impl<'a> Parser<'a> {
490490 prev_token : Token :: dummy ( ) ,
491491 capture_cfg : false ,
492492 restrictions : Restrictions :: empty ( ) ,
493- expected_tokens : Vec :: new ( ) ,
493+ expected_token_types : Vec :: new ( ) ,
494494 token_cursor : TokenCursor { curr : TokenTreeCursor :: new ( stream) , stack : Vec :: new ( ) } ,
495495 num_bump_calls : 0 ,
496496 break_last_token : 0 ,
@@ -554,7 +554,7 @@ impl<'a> Parser<'a> {
554554
555555 /// Expects and consumes the token `t`. Signals an error if the next token is not `t`.
556556 pub fn expect ( & mut self , t : & TokenKind ) -> PResult < ' a , Recovered > {
557- if self . expected_tokens . is_empty ( ) {
557+ if self . expected_token_types . is_empty ( ) {
558558 if self . token == * t {
559559 self . bump ( ) ;
560560 Ok ( Recovered :: No )
@@ -619,13 +619,13 @@ impl<'a> Parser<'a> {
619619
620620 /// Checks if the next token is `tok`, and returns `true` if so.
621621 ///
622- /// This method will automatically add `tok` to `expected_tokens ` if `tok` is not
622+ /// This method will automatically add `tok` to `expected_token_types ` if `tok` is not
623623 /// encountered.
624624 #[ inline]
625625 fn check ( & mut self , tok : & TokenKind ) -> bool {
626626 let is_present = self . token == * tok;
627627 if !is_present {
628- self . expected_tokens . push ( TokenType :: Token ( tok. clone ( ) ) ) ;
628+ self . expected_token_types . push ( TokenType :: Token ( tok. clone ( ) ) ) ;
629629 }
630630 is_present
631631 }
@@ -666,7 +666,7 @@ impl<'a> Parser<'a> {
666666 #[ inline]
667667 #[ must_use]
668668 fn check_keyword ( & mut self , kw : Symbol ) -> bool {
669- self . expected_tokens . push ( TokenType :: Keyword ( kw) ) ;
669+ self . expected_token_types . push ( TokenType :: Keyword ( kw) ) ;
670670 self . token . is_keyword ( kw)
671671 }
672672
@@ -755,7 +755,7 @@ impl<'a> Parser<'a> {
755755 if ok {
756756 true
757757 } else {
758- self . expected_tokens . push ( typ) ;
758+ self . expected_token_types . push ( typ) ;
759759 false
760760 }
761761 }
@@ -832,7 +832,7 @@ impl<'a> Parser<'a> {
832832 true
833833 }
834834 _ => {
835- self . expected_tokens . push ( TokenType :: Token ( expected) ) ;
835+ self . expected_token_types . push ( TokenType :: Token ( expected) ) ;
836836 false
837837 }
838838 }
@@ -1180,7 +1180,7 @@ impl<'a> Parser<'a> {
11801180 self . token_spacing = next_spacing;
11811181
11821182 // Diagnostics.
1183- self . expected_tokens . clear ( ) ;
1183+ self . expected_token_types . clear ( ) ;
11841184 }
11851185
11861186 /// Advance the parser by one token.
@@ -1670,8 +1670,8 @@ impl<'a> Parser<'a> {
16701670 DebugParser { parser : self , lookahead }
16711671 }
16721672
1673- pub fn clear_expected_tokens ( & mut self ) {
1674- self . expected_tokens . clear ( ) ;
1673+ pub fn clear_expected_token_types ( & mut self ) {
1674+ self . expected_token_types . clear ( ) ;
16751675 }
16761676
16771677 pub fn approx_token_stream_pos ( & self ) -> u32 {
0 commit comments