Work with spanned labels in break and continue

This commit is contained in:
Marcus Klaas 2015-09-05 14:00:16 +02:00
parent c838b00d54
commit 490821ef30

View File

@ -119,14 +119,14 @@ impl Rewrite for ast::Expr {
// `continue`
ast::Expr_::ExprAgain(ref opt_ident) => {
let id_str = match *opt_ident {
Some(ident) => format!(" {}", ident),
Some(ident) => format!(" {}", ident.node),
None => String::new(),
};
Some(format!("continue{}", id_str))
}
ast::Expr_::ExprBreak(ref opt_ident) => {
let id_str = match *opt_ident {
Some(ident) => format!(" {}", ident),
Some(ident) => format!(" {}", ident.node),
None => String::new(),
};
Some(format!("break{}", id_str))