1
Fork 0

Rename ast::ExprKind::Again -> ast::ExprKind::Continue

This commit is contained in:
Jeffrey Seyfried 2016-06-17 02:34:18 +00:00
parent 962d5c16b5
commit f0b21c2d1e
8 changed files with 9 additions and 9 deletions

View file

@ -1210,7 +1210,7 @@ impl<'a> LoweringContext<'a> {
hir::ExprPath(hir_qself, self.lower_path(path)) hir::ExprPath(hir_qself, self.lower_path(path))
} }
ExprKind::Break(opt_ident) => hir::ExprBreak(self.lower_opt_sp_ident(opt_ident)), ExprKind::Break(opt_ident) => hir::ExprBreak(self.lower_opt_sp_ident(opt_ident)),
ExprKind::Again(opt_ident) => hir::ExprAgain(self.lower_opt_sp_ident(opt_ident)), ExprKind::Continue(opt_ident) => hir::ExprAgain(self.lower_opt_sp_ident(opt_ident)),
ExprKind::Ret(ref e) => hir::ExprRet(e.as_ref().map(|x| self.lower_expr(x))), ExprKind::Ret(ref e) => hir::ExprRet(e.as_ref().map(|x| self.lower_expr(x))),
ExprKind::InlineAsm(InlineAsm { ExprKind::InlineAsm(InlineAsm {
ref inputs, ref inputs,

View file

@ -73,7 +73,7 @@ impl<'a, 'v> Visitor<'v> for AstValidator<'a> {
match expr.node { match expr.node {
ExprKind::While(_, _, Some(ident)) | ExprKind::Loop(_, Some(ident)) | ExprKind::While(_, _, Some(ident)) | ExprKind::Loop(_, Some(ident)) |
ExprKind::WhileLet(_, _, _, Some(ident)) | ExprKind::ForLoop(_, _, _, Some(ident)) | ExprKind::WhileLet(_, _, _, Some(ident)) | ExprKind::ForLoop(_, _, _, Some(ident)) |
ExprKind::Break(Some(ident)) | ExprKind::Again(Some(ident)) => { ExprKind::Break(Some(ident)) | ExprKind::Continue(Some(ident)) => {
self.check_label(ident.node, ident.span, expr.id); self.check_label(ident.node, ident.span, expr.id);
} }
_ => {} _ => {}

View file

@ -2988,7 +2988,7 @@ impl<'a> Resolver<'a> {
}) })
} }
ExprKind::Break(Some(label)) | ExprKind::Again(Some(label)) => { ExprKind::Break(Some(label)) | ExprKind::Continue(Some(label)) => {
match self.search_label(mtwt::resolve(label.node)) { match self.search_label(mtwt::resolve(label.node)) {
None => { None => {
self.record_def(expr.id, err_path_resolution()); self.record_def(expr.id, err_path_resolution());

View file

@ -1020,7 +1020,7 @@ pub enum ExprKind {
/// A `break`, with an optional label to break /// A `break`, with an optional label to break
Break(Option<SpannedIdent>), Break(Option<SpannedIdent>),
/// A `continue`, with an optional label /// A `continue`, with an optional label
Again(Option<SpannedIdent>), Continue(Option<SpannedIdent>),
/// A `return`, with an optional value to be returned /// A `return`, with an optional value to be returned
Ret(Option<P<Expr>>), Ret(Option<P<Expr>>),

View file

@ -1238,7 +1238,7 @@ pub fn noop_fold_expr<T: Folder>(Expr {id, node, span, attrs}: Expr, folder: &mu
respan(folder.new_span(label.span), respan(folder.new_span(label.span),
folder.fold_ident(label.node))) folder.fold_ident(label.node)))
), ),
ExprKind::Again(opt_ident) => ExprKind::Again(opt_ident.map(|label| ExprKind::Continue(opt_ident) => ExprKind::Continue(opt_ident.map(|label|
respan(folder.new_span(label.span), respan(folder.new_span(label.span),
folder.fold_ident(label.node))) folder.fold_ident(label.node)))
), ),

View file

@ -2285,14 +2285,14 @@ impl<'a> Parser<'a> {
} }
if self.eat_keyword(keywords::Continue) { if self.eat_keyword(keywords::Continue) {
let ex = if self.token.is_lifetime() { let ex = if self.token.is_lifetime() {
let ex = ExprKind::Again(Some(Spanned{ let ex = ExprKind::Continue(Some(Spanned{
node: self.get_lifetime(), node: self.get_lifetime(),
span: self.span span: self.span
})); }));
self.bump(); self.bump();
ex ex
} else { } else {
ExprKind::Again(None) ExprKind::Continue(None)
}; };
let hi = self.last_span.hi; let hi = self.last_span.hi;
return Ok(self.mk_expr(lo, hi, ex, attrs)); return Ok(self.mk_expr(lo, hi, ex, attrs));

View file

@ -2184,7 +2184,7 @@ impl<'a> State<'a> {
try!(space(&mut self.s)); try!(space(&mut self.s));
} }
} }
ast::ExprKind::Again(opt_ident) => { ast::ExprKind::Continue(opt_ident) => {
try!(word(&mut self.s, "continue")); try!(word(&mut self.s, "continue"));
try!(space(&mut self.s)); try!(space(&mut self.s));
if let Some(ident) = opt_ident { if let Some(ident) = opt_ident {

View file

@ -755,7 +755,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
} }
visitor.visit_path(path, expression.id) visitor.visit_path(path, expression.id)
} }
ExprKind::Break(ref opt_sp_ident) | ExprKind::Again(ref opt_sp_ident) => { ExprKind::Break(ref opt_sp_ident) | ExprKind::Continue(ref opt_sp_ident) => {
walk_opt_sp_ident(visitor, opt_sp_ident); walk_opt_sp_ident(visitor, opt_sp_ident);
} }
ExprKind::Ret(ref optional_expression) => { ExprKind::Ret(ref optional_expression) => {