diff options
| author | John Clements <clements@racket-lang.org> | 2014-06-27 14:12:13 -0700 |
|---|---|---|
| committer | John Clements <clements@racket-lang.org> | 2014-06-27 22:11:11 -0700 |
| commit | 268f6c56c219e97b444d78dadc387cc549e27aa6 (patch) | |
| tree | 1f445fe5054ac1cb0c7f830654147f027607d0f8 /src/libsyntax | |
| parent | 351a5fd2b40c2be90f94fe2580903e93353b95ee (diff) | |
| download | rust-268f6c56c219e97b444d78dadc387cc549e27aa6.tar.gz rust-268f6c56c219e97b444d78dadc387cc549e27aa6.zip | |
removed incomplete comment
as written, I don't believe this comment was helpful; I think it's better just to steer the reader toward a general understanding of hygiene.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/fold.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 01742ca131e..a6e4b4cae1c 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -391,23 +391,6 @@ fn fold_arg_<T: Folder>(a: &Arg, fld: &mut T) -> Arg { // build a new vector of tts by appling the Folder's fold_ident to // all of the identifiers in the token trees. -// -// This is part of hygiene magic. As far as hygiene is concerned, there -// are three types of let pattern bindings or loop labels: -// - those defined and used in non-macro part of the program -// - those used as part of macro invocation arguments -// - those defined and used inside macro definitions -// Lexically, type 1 and 2 are in one group and type 3 the other. If they -// clash, in order for let and loop label to work hygienically, one group -// or the other needs to be renamed. The problem is that type 2 and 3 are -// parsed together (inside the macro expand function). After being parsed and -// AST being constructed, they can no longer be distinguished from each other. -// -// For that reason, type 2 let bindings and loop labels are actually renamed -// in the form of tokens instead of AST nodes, here. There are wasted effort -// since many token::IDENT are not necessary part of let bindings and most -// token::LIFETIME are certainly not loop labels. But we can't tell in their -// token form. So this is less ideal and hacky but it works. pub fn fold_tts<T: Folder>(tts: &[TokenTree], fld: &mut T) -> Vec<TokenTree> { tts.iter().map(|tt| { match *tt { |
