@@ -144,7 +144,7 @@ pub struct Parser<'a> {
144
144
pub prev_token : Token ,
145
145
pub capture_cfg : bool ,
146
146
restrictions : Restrictions ,
147
- expected_tokens : Vec < TokenType > ,
147
+ expected_token_types : Vec < TokenType > ,
148
148
token_cursor : TokenCursor ,
149
149
// The number of calls to `bump`, i.e. the position in the token stream.
150
150
num_bump_calls : u32 ,
@@ -465,7 +465,7 @@ impl<'a> Parser<'a> {
465
465
prev_token : Token :: dummy ( ) ,
466
466
capture_cfg : false ,
467
467
restrictions : Restrictions :: empty ( ) ,
468
- expected_tokens : Vec :: new ( ) ,
468
+ expected_token_types : Vec :: new ( ) ,
469
469
token_cursor : TokenCursor { tree_cursor : stream. into_trees ( ) , stack : Vec :: new ( ) } ,
470
470
num_bump_calls : 0 ,
471
471
break_last_token : 0 ,
@@ -529,7 +529,7 @@ impl<'a> Parser<'a> {
529
529
530
530
/// Expects and consumes the token `t`. Signals an error if the next token is not `t`.
531
531
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 ( ) {
533
533
if self . token == * t {
534
534
self . bump ( ) ;
535
535
Ok ( Recovered :: No )
@@ -594,13 +594,13 @@ impl<'a> Parser<'a> {
594
594
595
595
/// Checks if the next token is `tok`, and returns `true` if so.
596
596
///
597
- /// This method will automatically add `tok` to `expected_tokens ` if `tok` is not
597
+ /// This method will automatically add `tok` to `expected_token_types ` if `tok` is not
598
598
/// encountered.
599
599
#[ inline]
600
600
fn check ( & mut self , tok : & TokenKind ) -> bool {
601
601
let is_present = self . token == * tok;
602
602
if !is_present {
603
- self . expected_tokens . push ( TokenType :: Token ( tok. clone ( ) ) ) ;
603
+ self . expected_token_types . push ( TokenType :: Token ( tok. clone ( ) ) ) ;
604
604
}
605
605
is_present
606
606
}
@@ -641,7 +641,7 @@ impl<'a> Parser<'a> {
641
641
#[ inline]
642
642
#[ must_use]
643
643
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) ) ;
645
645
self . token . is_keyword ( kw)
646
646
}
647
647
@@ -730,7 +730,7 @@ impl<'a> Parser<'a> {
730
730
if ok {
731
731
true
732
732
} else {
733
- self . expected_tokens . push ( typ) ;
733
+ self . expected_token_types . push ( typ) ;
734
734
false
735
735
}
736
736
}
@@ -807,7 +807,7 @@ impl<'a> Parser<'a> {
807
807
true
808
808
}
809
809
_ => {
810
- self . expected_tokens . push ( TokenType :: Token ( expected) ) ;
810
+ self . expected_token_types . push ( TokenType :: Token ( expected) ) ;
811
811
false
812
812
}
813
813
}
@@ -1155,7 +1155,7 @@ impl<'a> Parser<'a> {
1155
1155
self . token_spacing = next_spacing;
1156
1156
1157
1157
// Diagnostics.
1158
- self . expected_tokens . clear ( ) ;
1158
+ self . expected_token_types . clear ( ) ;
1159
1159
}
1160
1160
1161
1161
/// Advance the parser by one token.
@@ -1643,8 +1643,8 @@ impl<'a> Parser<'a> {
1643
1643
DebugParser { parser : self , lookahead }
1644
1644
}
1645
1645
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 ( ) ;
1648
1648
}
1649
1649
1650
1650
pub fn approx_token_stream_pos ( & self ) -> u32 {
0 commit comments