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:
parent
551da06157
commit
386db05df8
18 changed files with 262 additions and 28 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue