From 3965725d51508e185f03bda0ce883f56c1d980e5 Mon Sep 17 00:00:00 2001 From: John Clements Date: Fri, 7 Jun 2013 10:41:38 -0700 Subject: [PATCH] comments --- src/libsyntax/ast.rs | 1 + src/libsyntax/ext/expand.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index c7e197ade092..b3fb8859f658 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -98,6 +98,7 @@ pub enum SyntaxContext_ { // in the "from" slot. In essence, they're all // pointers to a single "rename" event node. Rename (Ident,Name,SyntaxContext), + // actually, IllegalCtxt may not be necessary. IllegalCtxt } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 196e8644cd3d..a75238d269b3 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -553,6 +553,8 @@ fn expand_non_macro_stmt (exts: SyntaxEnv, let expanded_pat = fld.fold_pat(pat); // find the pat_idents in the pattern: // oh dear heaven... this is going to include the enum names, as well.... + // ... but that should be okay, as long as the new names are gensyms + // for the old ones. let idents = @mut ~[]; let name_finder = new_name_finder(idents); name_finder.visit_pat(expanded_pat,()); @@ -1467,6 +1469,7 @@ mod test { #[test] fn automatic_renaming () { + // need some other way to test these... let teststrs = ~[// b & c should get new names throughout, in the expr too: @"fn a() -> int { let b = 13; let c = b; b+c }",