From 8651839a661499d316364f32ea4797a48a86697e Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 5 Jan 2017 02:55:11 -0800 Subject: [PATCH] Getting rid of some newlines - concision --- src/parser.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 51cb9f7..4e8aa47 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -275,7 +275,6 @@ impl Parser { } fn body(&mut self) -> ParseResult> { - let statements = delimiter_block!( self, statement, @@ -312,7 +311,6 @@ impl Parser { lhs = Expression::BinExp(op.0, Box::new(lhs), Box::new(rhs)); } - Ok(lhs) } @@ -346,15 +344,12 @@ impl Parser { fn while_expr(&mut self) -> ParseResult { use self::Expression::*; expect!(self, Keyword(Kw::While)); - let test = try!(self.expression()); - let body = delimiter_block!( self, expression, Some(Keyword(Kw::End)) ); - expect!(self, Keyword(Kw::End)); Ok(While(Box::new(test), body)) } @@ -362,9 +357,7 @@ impl Parser { fn conditional_expr(&mut self) -> ParseResult { use self::Expression::*; expect!(self, Keyword(Kw::If)); - let test = try!(self.expression()); - loop { match self.peek() { Some(ref t) if is_delimiter(t) => { @@ -374,14 +367,12 @@ impl Parser { _ => break, } } - expect!(self, Keyword(Kw::Then)); let then_block = delimiter_block!( self, expression, Some(Keyword(Kw::Else)) | Some(Keyword(Kw::End)) ); - let else_block = if let Some(Keyword(Kw::Else)) = self.peek() { self.next(); let else_exprs = delimiter_block!( @@ -393,7 +384,6 @@ impl Parser { } else { None }; - expect!(self, Keyword(Kw::End)); Ok(Conditional(Box::new(test), Box::new(Block(VecDeque::from(then_block))), @@ -409,7 +399,6 @@ impl Parser { } __ => Expression::Variable(name), }; - Ok(expr) }