@@ -562,6 +562,7 @@ impl<'a> Parser<'a> {
562
562
///
563
563
/// the main purpose of this function is to reduce the cluttering of the suggestions list
564
564
/// which using the normal eat method could introduce in some cases.
565
+ #[ inline]
565
566
pub fn eat_noexpect ( & mut self , tok : & TokenKind ) -> bool {
566
567
let is_present = self . check_noexpect ( tok) ;
567
568
if is_present {
@@ -582,11 +583,13 @@ impl<'a> Parser<'a> {
582
583
583
584
/// If the next token is the given keyword, returns `true` without eating it.
584
585
/// An expectation is also added for diagnostics purposes.
586
+ #[ inline]
585
587
fn check_keyword ( & mut self , kw : Symbol ) -> bool {
586
588
self . expected_tokens . push ( TokenType :: Keyword ( kw) ) ;
587
589
self . token . is_keyword ( kw)
588
590
}
589
591
592
+ #[ inline]
590
593
fn check_keyword_case ( & mut self , kw : Symbol , case : Case ) -> bool {
591
594
if self . check_keyword ( kw) {
592
595
return true ;
@@ -605,6 +608,7 @@ impl<'a> Parser<'a> {
605
608
/// If the next token is the given keyword, eats it and returns `true`.
606
609
/// Otherwise, returns `false`. An expectation is also added for diagnostics purposes.
607
610
// Public for rustfmt usage.
611
+ #[ inline]
608
612
pub fn eat_keyword ( & mut self , kw : Symbol ) -> bool {
609
613
if self . check_keyword ( kw) {
610
614
self . bump ( ) ;
@@ -617,6 +621,7 @@ impl<'a> Parser<'a> {
617
621
/// Eats a keyword, optionally ignoring the case.
618
622
/// If the case differs (and is ignored) an error is issued.
619
623
/// This is useful for recovery.
624
+ #[ inline]
620
625
fn eat_keyword_case ( & mut self , kw : Symbol , case : Case ) -> bool {
621
626
if self . eat_keyword ( kw) {
622
627
return true ;
@@ -634,6 +639,7 @@ impl<'a> Parser<'a> {
634
639
false
635
640
}
636
641
642
+ #[ inline]
637
643
fn eat_keyword_noexpect ( & mut self , kw : Symbol ) -> bool {
638
644
if self . token . is_keyword ( kw) {
639
645
self . bump ( ) ;
@@ -655,6 +661,7 @@ impl<'a> Parser<'a> {
655
661
self . token . is_keyword ( kw) && self . look_ahead ( 1 , |t| t. is_ident ( ) && !t. is_reserved_ident ( ) )
656
662
}
657
663
664
+ #[ inline]
658
665
fn check_or_expected ( & mut self , ok : bool , typ : TokenType ) -> bool {
659
666
if ok {
660
667
true
@@ -702,6 +709,7 @@ impl<'a> Parser<'a> {
702
709
703
710
/// Checks to see if the next token is either `+` or `+=`.
704
711
/// Otherwise returns `false`.
712
+ #[ inline]
705
713
fn check_plus ( & mut self ) -> bool {
706
714
self . check_or_expected (
707
715
self . token . is_like_plus ( ) ,
@@ -742,6 +750,7 @@ impl<'a> Parser<'a> {
742
750
}
743
751
744
752
/// Eats `+` possibly breaking tokens like `+=` in process.
753
+ #[ inline]
745
754
fn eat_plus ( & mut self ) -> bool {
746
755
self . break_and_eat ( token:: BinOp ( token:: Plus ) )
747
756
}
@@ -759,6 +768,7 @@ impl<'a> Parser<'a> {
759
768
}
760
769
761
770
/// Eats `<` possibly breaking tokens like `<<` in process.
771
+ #[ inline]
762
772
fn eat_lt ( & mut self ) -> bool {
763
773
let ate = self . break_and_eat ( token:: Lt ) ;
764
774
if ate {
@@ -1374,7 +1384,6 @@ impl<'a> Parser<'a> {
1374
1384
/// Evaluates the closure with restrictions in place.
1375
1385
///
1376
1386
/// Afters the closure is evaluated, restrictions are reset.
1377
- #[ inline]
1378
1387
fn with_res < T > ( & mut self , res : Restrictions , f : impl FnOnce ( & mut Self ) -> T ) -> T {
1379
1388
let old = self . restrictions ;
1380
1389
self . restrictions = res;
@@ -1509,6 +1518,7 @@ impl<'a> Parser<'a> {
1509
1518
}
1510
1519
1511
1520
/// `::{` or `::*`
1521
+ #[ inline]
1512
1522
fn is_import_coupler ( & mut self ) -> bool {
1513
1523
self . check ( & token:: ModSep )
1514
1524
&& self . look_ahead ( 1 , |t| {
0 commit comments