@@ -144,7 +144,7 @@ pub struct Parser<'a> {
144144 pub prev_token : Token ,
145145 pub capture_cfg : bool ,
146146 restrictions : Restrictions ,
147- expected_tokens : Vec < TokenType > ,
147+ expected_token_types : Vec < TokenType > ,
148148 token_cursor : TokenCursor ,
149149 // The number of calls to `bump`, i.e. the position in the token stream.
150150 num_bump_calls : u32 ,
@@ -465,7 +465,7 @@ impl<'a> Parser<'a> {
465465 prev_token : Token :: dummy ( ) ,
466466 capture_cfg : false ,
467467 restrictions : Restrictions :: empty ( ) ,
468- expected_tokens : Vec :: new ( ) ,
468+ expected_token_types : Vec :: new ( ) ,
469469 token_cursor : TokenCursor { tree_cursor : stream. into_trees ( ) , stack : Vec :: new ( ) } ,
470470 num_bump_calls : 0 ,
471471 break_last_token : 0 ,
@@ -529,7 +529,7 @@ impl<'a> Parser<'a> {
529529
530530 /// Expects and consumes the token `t`. Signals an error if the next token is not `t`.
531531 pub fn expect ( & mut self , t : & TokenKind ) -> PResult < ' a , Recovered > {
532- if self . expected_tokens . is_empty ( ) {
532+ if self . expected_token_types . is_empty ( ) {
533533 if self . token == * t {
534534 self . bump ( ) ;
535535 Ok ( Recovered :: No )
@@ -600,7 +600,7 @@ impl<'a> Parser<'a> {
600600 fn check ( & mut self , tok : & TokenKind ) -> bool {
601601 let is_present = self . token == * tok;
602602 if !is_present {
603- self . expected_tokens . push ( TokenType :: Token ( tok. clone ( ) ) ) ;
603+ self . expected_token_types . push ( TokenType :: Token ( tok. clone ( ) ) ) ;
604604 }
605605 is_present
606606 }
@@ -641,7 +641,7 @@ impl<'a> Parser<'a> {
641641 #[ inline]
642642 #[ must_use]
643643 fn check_keyword ( & mut self , kw : Symbol ) -> bool {
644- self . expected_tokens . push ( TokenType :: Keyword ( kw) ) ;
644+ self . expected_token_types . push ( TokenType :: Keyword ( kw) ) ;
645645 self . token . is_keyword ( kw)
646646 }
647647
@@ -730,7 +730,7 @@ impl<'a> Parser<'a> {
730730 if ok {
731731 true
732732 } else {
733- self . expected_tokens . push ( typ) ;
733+ self . expected_token_types . push ( typ) ;
734734 false
735735 }
736736 }
@@ -807,7 +807,7 @@ impl<'a> Parser<'a> {
807807 true
808808 }
809809 _ => {
810- self . expected_tokens . push ( TokenType :: Token ( expected) ) ;
810+ self . expected_token_types . push ( TokenType :: Token ( expected) ) ;
811811 false
812812 }
813813 }
@@ -1155,7 +1155,7 @@ impl<'a> Parser<'a> {
11551155 self . token_spacing = next_spacing;
11561156
11571157 // Diagnostics.
1158- self . expected_tokens . clear ( ) ;
1158+ self . expected_token_types . clear ( ) ;
11591159 }
11601160
11611161 /// Advance the parser by one token.
@@ -1643,8 +1643,8 @@ impl<'a> Parser<'a> {
16431643 DebugParser { parser : self , lookahead }
16441644 }
16451645
1646- pub fn clear_expected_tokens ( & mut self ) {
1647- self . expected_tokens . clear ( ) ;
1646+ pub fn clear_expected_token_types ( & mut self ) {
1647+ self . expected_token_types . clear ( ) ;
16481648 }
16491649
16501650 pub fn approx_token_stream_pos ( & self ) -> u32 {
0 commit comments