File tree Expand file tree Collapse file tree 2 files changed +1
-18
lines changed
branches/try2/src/libsyntax Expand file tree Collapse file tree 2 files changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 351a5fd2b40c2be90f94fe2580903e93353b95ee
8
+ refs/heads/try2: 268f6c56c219e97b444d78dadc387cc549e27aa6
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -391,23 +391,6 @@ fn fold_arg_<T: Folder>(a: &Arg, fld: &mut T) -> Arg {
391
391
392
392
// build a new vector of tts by appling the Folder's fold_ident to
393
393
// all of the identifiers in the token trees.
394
- //
395
- // This is part of hygiene magic. As far as hygiene is concerned, there
396
- // are three types of let pattern bindings or loop labels:
397
- // - those defined and used in non-macro part of the program
398
- // - those used as part of macro invocation arguments
399
- // - those defined and used inside macro definitions
400
- // Lexically, type 1 and 2 are in one group and type 3 the other. If they
401
- // clash, in order for let and loop label to work hygienically, one group
402
- // or the other needs to be renamed. The problem is that type 2 and 3 are
403
- // parsed together (inside the macro expand function). After being parsed and
404
- // AST being constructed, they can no longer be distinguished from each other.
405
- //
406
- // For that reason, type 2 let bindings and loop labels are actually renamed
407
- // in the form of tokens instead of AST nodes, here. There are wasted effort
408
- // since many token::IDENT are not necessary part of let bindings and most
409
- // token::LIFETIME are certainly not loop labels. But we can't tell in their
410
- // token form. So this is less ideal and hacky but it works.
411
394
pub fn fold_tts < T : Folder > ( tts : & [ TokenTree ] , fld : & mut T ) -> Vec < TokenTree > {
412
395
tts. iter ( ) . map ( |tt| {
413
396
match * tt {
You can’t perform that action at this time.
0 commit comments