Formatting fixes
This commit is contained in:
parent
1ab50f3600
commit
98a4770a98
2 changed files with 21 additions and 13 deletions
|
@ -1661,7 +1661,10 @@ impl<'a> Parser<'a> {
|
||||||
LitBinary(parse::binary_lit(i.as_str())),
|
LitBinary(parse::binary_lit(i.as_str())),
|
||||||
token::LitBinaryRaw(i, _) =>
|
token::LitBinaryRaw(i, _) =>
|
||||||
LitBinary(Rc::new(i.as_str().as_bytes().iter().map(|&x| x).collect())),
|
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); }
|
_ => { self.unexpected_last(tok); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2047,7 +2050,8 @@ impl<'a> Parser<'a> {
|
||||||
return self.mk_expr(lo, hi, ExprLit(lit));
|
return self.mk_expr(lo, hi, ExprLit(lit));
|
||||||
}
|
}
|
||||||
let mut es = vec!(self.parse_expr());
|
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 {
|
while self.token == token::Comma {
|
||||||
self.bump();
|
self.bump();
|
||||||
if self.token != token::CloseDelim(token::Paren) {
|
if self.token != token::CloseDelim(token::Paren) {
|
||||||
|
@ -2454,7 +2458,8 @@ impl<'a> Parser<'a> {
|
||||||
// e[e..e]
|
// e[e..e]
|
||||||
_ => {
|
_ => {
|
||||||
let e2 = self.parse_expr();
|
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)
|
Some(e2)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2720,7 +2725,9 @@ impl<'a> Parser<'a> {
|
||||||
self.bump();
|
self.bump();
|
||||||
let last_span = self.last_span;
|
let last_span = self.last_span;
|
||||||
match self.token {
|
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)
|
_ => self.obsolete(last_span, ObsoleteOwnedExpr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3704,7 +3711,8 @@ impl<'a> Parser<'a> {
|
||||||
// expression without semicolon
|
// expression without semicolon
|
||||||
if classify::expr_requires_semi_to_be_stmt(&*e) {
|
if classify::expr_requires_semi_to_be_stmt(&*e) {
|
||||||
// Just check for errors and recover; do not eat semicolon yet.
|
// 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 {
|
match self.token {
|
||||||
|
|
|
@ -267,7 +267,7 @@ impl Token {
|
||||||
pub fn is_plain_ident(&self) -> bool {
|
pub fn is_plain_ident(&self) -> bool {
|
||||||
match *self {
|
match *self {
|
||||||
Ident(_, Plain) => true,
|
Ident(_, Plain) => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,20 +392,20 @@ impl Token {
|
||||||
#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash)]
|
#[deriving(Clone, Encodable, Decodable, PartialEq, Eq, Hash)]
|
||||||
/// For interpolation during macro expansion.
|
/// For interpolation during macro expansion.
|
||||||
pub enum Nonterminal {
|
pub enum Nonterminal {
|
||||||
NtItem( P<ast::Item>),
|
NtItem(P<ast::Item>),
|
||||||
NtBlock(P<ast::Block>),
|
NtBlock(P<ast::Block>),
|
||||||
NtStmt( P<ast::Stmt>),
|
NtStmt(P<ast::Stmt>),
|
||||||
NtPat( P<ast::Pat>),
|
NtPat(P<ast::Pat>),
|
||||||
NtExpr( P<ast::Expr>),
|
NtExpr(P<ast::Expr>),
|
||||||
NtTy( P<ast::Ty>),
|
NtTy(P<ast::Ty>),
|
||||||
#[cfg(stage0)]
|
#[cfg(stage0)]
|
||||||
NtIdent(Box<ast::Ident>, bool),
|
NtIdent(Box<ast::Ident>, bool),
|
||||||
#[cfg(not(stage0))]
|
#[cfg(not(stage0))]
|
||||||
NtIdent(Box<ast::Ident>, IdentStyle),
|
NtIdent(Box<ast::Ident>, IdentStyle),
|
||||||
/// Stuff inside brackets for attributes
|
/// Stuff inside brackets for attributes
|
||||||
NtMeta( P<ast::MetaItem>),
|
NtMeta(P<ast::MetaItem>),
|
||||||
NtPath(Box<ast::Path>),
|
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>)
|
NtMatchers(Vec<ast::Matcher>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue