diff options
| author | Edward Wang <edward.yu.wang@gmail.com> | 2014-02-15 16:54:32 +0800 |
|---|---|---|
| committer | Edward Wang <edward.yu.wang@gmail.com> | 2014-02-23 21:20:37 +0800 |
| commit | 386db05df8aa8349857ad6f5486db0bdcc79f3cd (patch) | |
| tree | b85d659e88e28126c3874a194126079c280b7739 /src/libsyntax/parse/token.rs | |
| parent | 551da0615764853153db944063ae2e271414a71b (diff) | |
| download | rust-386db05df8aa8349857ad6f5486db0bdcc79f3cd.tar.gz rust-386db05df8aa8349857ad6f5486db0bdcc79f3cd.zip | |
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.
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index b264e8d7467..5da4e4c44df 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -704,8 +704,8 @@ pub fn is_reserved_keyword(tok: &Token) -> bool { pub fn mtwt_token_eq(t1 : &Token, t2 : &Token) -> bool { match (t1,t2) { - (&IDENT(id1,_),&IDENT(id2,_)) => - ast_util::mtwt_resolve(id1) == ast_util::mtwt_resolve(id2), + (&IDENT(id1,_),&IDENT(id2,_)) | (&LIFETIME(id1),&LIFETIME(id2)) => + ast_util::mtwt_resolve(id1) == ast_util::mtwt_resolve(id2), _ => *t1 == *t2 } } |
