@@ -449,6 +449,7 @@ impl<'a> Parser<'a> {
449
449
parser
450
450
}
451
451
452
+ #[ inline]
452
453
pub fn recovery ( mut self , recovery : Recovery ) -> Self {
453
454
self . recovery = recovery;
454
455
self
@@ -461,6 +462,7 @@ impl<'a> Parser<'a> {
461
462
///
462
463
/// Technically, this only needs to restrict eager recovery by doing lookahead at more tokens.
463
464
/// But making the distinction is very subtle, and simply forbidding all recovery is a lot simpler to uphold.
465
+ #[ inline]
464
466
fn may_recover ( & self ) -> bool {
465
467
matches ! ( self . recovery, Recovery :: Allowed )
466
468
}
@@ -542,6 +544,7 @@ impl<'a> Parser<'a> {
542
544
///
543
545
/// This method will automatically add `tok` to `expected_tokens` if `tok` is not
544
546
/// encountered.
547
+ #[ inline]
545
548
fn check ( & mut self , tok : & TokenKind ) -> bool {
546
549
let is_present = self . token == * tok;
547
550
if !is_present {
@@ -550,6 +553,7 @@ impl<'a> Parser<'a> {
550
553
is_present
551
554
}
552
555
556
+ #[ inline]
553
557
fn check_noexpect ( & self , tok : & TokenKind ) -> bool {
554
558
self . token == * tok
555
559
}
@@ -567,6 +571,7 @@ impl<'a> Parser<'a> {
567
571
}
568
572
569
573
/// Consumes a token 'tok' if it exists. Returns whether the given token was present.
574
+ #[ inline]
570
575
pub fn eat ( & mut self , tok : & TokenKind ) -> bool {
571
576
let is_present = self . check ( tok) ;
572
577
if is_present {
@@ -1369,6 +1374,7 @@ impl<'a> Parser<'a> {
1369
1374
/// Evaluates the closure with restrictions in place.
1370
1375
///
1371
1376
/// Afters the closure is evaluated, restrictions are reset.
1377
+ #[ inline]
1372
1378
fn with_res < T > ( & mut self , res : Restrictions , f : impl FnOnce ( & mut Self ) -> T ) -> T {
1373
1379
let old = self . restrictions ;
1374
1380
self . restrictions = res;
0 commit comments