]> git.lizzy.rs Git - rust.git/commitdiff
Refactor away `parser.commit_stmt_expecting()`
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Wed, 29 Jun 2016 06:40:05 +0000 (06:40 +0000)
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>
Wed, 29 Jun 2016 06:40:05 +0000 (06:40 +0000)
src/libsyntax/parse/parser.rs

index 813d90103b8878000bf4f103078bc3781c3e28dd..20a54228d016cdb222a1975dc219332586227349 100644 (file)
@@ -553,10 +553,6 @@ pub fn commit_stmt(&mut self, edible: &[token::Token],
         self.expect_one_of(edible, inedible)
     }
 
-    pub fn commit_stmt_expecting(&mut self, edible: token::Token) -> PResult<'a, ()> {
-        self.commit_stmt(&[edible], &[])
-    }
-
     /// returns the span of expr, if it was not interpolated or the span of the interpolated token
     fn interpolated_or_expr_span(&self,
                                  expr: PResult<'a, P<Expr>>)
@@ -4122,7 +4118,7 @@ fn parse_block_tail(&mut self, lo: BytePos, s: BlockCheckMode) -> PResult<'a, P<
                 _ => { // all other kinds of statements:
                     let mut hi = span.hi;
                     if classify::stmt_ends_with_semi(&node) {
-                        self.commit_stmt_expecting(token::Semi)?;
+                        self.commit_stmt(&[token::Semi], &[])?;
                         hi = self.last_span.hi;
                     }