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 @@ fn make_struct(this: &mut LoweringContext,
hir::ExprPath(hir_qself, self.lower_path(path))
}
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::InlineAsm(InlineAsm {
ref inputs,

View File

@ -73,7 +73,7 @@ fn visit_expr(&mut self, expr: &Expr) {
match expr.node {
ExprKind::While(_, _, Some(ident)) | ExprKind::Loop(_, 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);
}
_ => {}

View File

@ -2988,7 +2988,7 @@ fn resolve_expr(&mut self, expr: &Expr, parent: Option<&Expr>) {
})
}
ExprKind::Break(Some(label)) | ExprKind::Again(Some(label)) => {
ExprKind::Break(Some(label)) | ExprKind::Continue(Some(label)) => {
match self.search_label(mtwt::resolve(label.node)) {
None => {
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
Break(Option<SpannedIdent>),
/// A `continue`, with an optional label
Again(Option<SpannedIdent>),
Continue(Option<SpannedIdent>),
/// A `return`, with an optional value to be returned
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),
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),
folder.fold_ident(label.node)))
),

View File

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

View File

@ -2184,7 +2184,7 @@ fn print_expr_outer_attr_style(&mut self,
try!(space(&mut self.s));
}
}
ast::ExprKind::Again(opt_ident) => {
ast::ExprKind::Continue(opt_ident) => {
try!(word(&mut self.s, "continue"));
try!(space(&mut self.s));
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)
}
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);
}
ExprKind::Ret(ref optional_expression) => {