1
Fork 0

Make break and continue hygienic

Makes labelled loops hygiene by performing renaming of the labels
defined in e.g. `'x: loop { ... }` and then used in break and continue
statements within loop body so that they act hygienically when used with
macros.

Closes #12262.
This commit is contained in:
Edward Wang 2014-02-15 16:54:32 +08:00
parent 551da06157
commit 386db05df8
18 changed files with 262 additions and 28 deletions

View file

@ -1471,7 +1471,7 @@ pub fn print_expr(s: &mut State, expr: &ast::Expr) -> io::IoResult<()> {
try!(space(&mut s.s));
for ident in opt_ident.iter() {
try!(word(&mut s.s, "'"));
try!(print_name(s, *ident));
try!(print_ident(s, *ident));
try!(space(&mut s.s));
}
}
@ -1480,7 +1480,7 @@ pub fn print_expr(s: &mut State, expr: &ast::Expr) -> io::IoResult<()> {
try!(space(&mut s.s));
for ident in opt_ident.iter() {
try!(word(&mut s.s, "'"));
try!(print_name(s, *ident));
try!(print_ident(s, *ident));
try!(space(&mut s.s))
}
}