diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-10-30 08:44:41 +1100 |
|---|---|---|
| committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-10-30 09:35:53 +1100 |
| commit | 98a4770a981b779c06a08c642ccefc6c6b5c16a9 (patch) | |
| tree | 2898e0a7d1855c5b715456900ef03234d832ce3c /src/libsyntax | |
| parent | 1ab50f3600ff52dcf97f0cd2b32f632988540b97 (diff) | |
| download | rust-98a4770a981b779c06a08c642ccefc6c6b5c16a9.tar.gz rust-98a4770a981b779c06a08c642ccefc6c6b5c16a9.zip | |
Formatting fixes
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 18 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 16 |
2 files changed, 21 insertions, 13 deletions
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<ast::Item>), + NtItem(P<ast::Item>), NtBlock(P<ast::Block>), - NtStmt( P<ast::Stmt>), - NtPat( P<ast::Pat>), - NtExpr( P<ast::Expr>), - NtTy( P<ast::Ty>), + NtStmt(P<ast::Stmt>), + NtPat(P<ast::Pat>), + NtExpr(P<ast::Expr>), + NtTy(P<ast::Ty>), #[cfg(stage0)] NtIdent(Box<ast::Ident>, bool), #[cfg(not(stage0))] NtIdent(Box<ast::Ident>, IdentStyle), /// Stuff inside brackets for attributes - NtMeta( P<ast::MetaItem>), + NtMeta(P<ast::MetaItem>), NtPath(Box<ast::Path>), - NtTT( P<ast::TokenTree>), // needs P'ed to break a circularity + NtTT(P<ast::TokenTree>), // needs P'ed to break a circularity NtMatchers(Vec<ast::Matcher>) } |
