Formatting fixes

This commit is contained in:
Brendan Zabarauskas 2014-10-30 08:44:41 +11:00
parent 1ab50f3600
commit 98a4770a98
2 changed files with 21 additions and 13 deletions

View File

@ -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 {

View File

@ -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>)
}