From 98a4770a981b779c06a08c642ccefc6c6b5c16a9 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Thu, 30 Oct 2014 08:44:41 +1100 Subject: Formatting fixes --- src/libsyntax/parse/parser.rs | 18 +++++++++++++----- src/libsyntax/parse/token.rs | 16 ++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 8bd984b60ed..54730391d56 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1661,7 +1661,10 @@ impl<'a> Parser<'a> { LitBinary(parse::binary_lit(i.as_str())), token::LitBinaryRaw(i, _) => LitBinary(Rc::new(i.as_str().as_bytes().iter().map(|&x| x).collect())), - token::OpenDelim(token::Paren) => { self.expect(&token::CloseDelim(token::Paren)); LitNil }, + token::OpenDelim(token::Paren) => { + self.expect(&token::CloseDelim(token::Paren)); + LitNil + }, _ => { self.unexpected_last(tok); } } } @@ -2047,7 +2050,8 @@ impl<'a> Parser<'a> { return self.mk_expr(lo, hi, ExprLit(lit)); } let mut es = vec!(self.parse_expr()); - self.commit_expr(&**es.last().unwrap(), &[], &[token::Comma, token::CloseDelim(token::Paren)]); + self.commit_expr(&**es.last().unwrap(), &[], + &[token::Comma, token::CloseDelim(token::Paren)]); while self.token == token::Comma { self.bump(); if self.token != token::CloseDelim(token::Paren) { @@ -2454,7 +2458,8 @@ impl<'a> Parser<'a> { // e[e..e] _ => { let e2 = self.parse_expr(); - self.commit_expr_expecting(&*e2, token::CloseDelim(token::Bracket)); + self.commit_expr_expecting(&*e2, + token::CloseDelim(token::Bracket)); Some(e2) } }; @@ -2720,7 +2725,9 @@ impl<'a> Parser<'a> { self.bump(); let last_span = self.last_span; match self.token { - token::OpenDelim(token::Bracket) => self.obsolete(last_span, ObsoleteOwnedVector), + token::OpenDelim(token::Bracket) => { + self.obsolete(last_span, ObsoleteOwnedVector) + }, _ => self.obsolete(last_span, ObsoleteOwnedExpr) } @@ -3704,7 +3711,8 @@ impl<'a> Parser<'a> { // expression without semicolon if classify::expr_requires_semi_to_be_stmt(&*e) { // Just check for errors and recover; do not eat semicolon yet. - self.commit_stmt(&[], &[token::Semi, token::CloseDelim(token::Brace)]); + self.commit_stmt(&[], &[token::Semi, + token::CloseDelim(token::Brace)]); } match self.token { diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 2025b65835e..641e3817949 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -267,7 +267,7 @@ impl Token { pub fn is_plain_ident(&self) -> bool { match *self { Ident(_, Plain) => true, - _ => false, + _ => false, } } @@ -392,20 +392,20 @@ impl Token { #[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash)] /// For interpolation during macro expansion. pub enum Nonterminal { - NtItem( P), + NtItem(P), NtBlock(P), - NtStmt( P), - NtPat( P), - NtExpr( P), - NtTy( P), + NtStmt(P), + NtPat(P), + NtExpr(P), + NtTy(P), #[cfg(stage0)] NtIdent(Box, bool), #[cfg(not(stage0))] NtIdent(Box, IdentStyle), /// Stuff inside brackets for attributes - NtMeta( P), + NtMeta(P), NtPath(Box), - NtTT( P), // needs P'ed to break a circularity + NtTT(P), // needs P'ed to break a circularity NtMatchers(Vec) } -- cgit 1.4.1-3-g733a5