Skip to content

Commit 9eb52dc

Browse files
committed
---
yaml --- r: 79455 b: refs/heads/snap-stage3 c: 6c6d053 h: refs/heads/master i: 79453: 4b90596 79451: 35650f5 79447: 9601f13 79439: 32a2dae 79423: ab19176 v: v3
1 parent 313a395 commit 9eb52dc

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 124eb2119c78651cfaaa7a046a101fa2e20f83ca
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 2f6498f7b4be2584d1164d68fc4d5ae485da2ea6
4+
refs/heads/snap-stage3: 6c6d053b0177ed91071128aa5a2f57539e746987
55
refs/heads/try: ac820906c0e53eab79a98ee64f7231f57c3887b4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libsyntax/ext/expand.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,10 +1452,6 @@ mod test {
14521452
pprust::print_mod(s, &crate.module, crate.attrs);
14531453
}
14541454
1455-
// "fn a() -> int { let b = 13; let c = b; b+c }" --> b & c should get new names, in the expr too.
1456-
// "macro_rules! f (($x:ident) => ($x + b)) fn a() -> int { let b = 13; f!(b)}" --> one should
1457-
// be renamed, one should not.
1458-
14591455
fn expand_and_resolve_and_pretty_print (crate_str : @str) -> ~str {
14601456
let resolver = new_ident_resolver();
14611457
let resolver_fold = fun_to_ident_folder(resolver);
@@ -1469,10 +1465,20 @@ mod test {
14691465

14701466
#[test]
14711467
fn automatic_renaming () {
1468+
// "fn a() -> int { let b = 13; let c = b; b+c }"
1469+
// --> b & c should get new names, in the expr too.
1470+
// "macro_rules! f (($x:ident) => ($x + b)) fn a() -> int { let b = 13; f!(b)}"
1471+
// --> one should be renamed, one should not.
1472+
14721473
let teststrs =
1473-
~[@"fn a() -> int { let b = 13; let c = b; b+c }",
1474-
@"macro_rules! f (($x:ident) => ($x + b)) fn a() -> int { let b = 13; f!(b)}"];
1474+
~[// b & c should get new names throughout, in the expr too:
1475+
@"fn a() -> int { let b = 13; let c = b; b+c }",
1476+
// the use of b before the + should be renamed, the other one not:
1477+
@"macro_rules! f (($x:ident) => ($x + b)) fn a() -> int { let b = 13; f!(b)}",
1478+
// the b before the plus should not be renamed (requires marks)
1479+
@"macro_rules! f (($x:ident) => ({let b=9; ($x + b)})) fn a() -> int { f!(b)}"];
14751480
for s in teststrs.iter() {
1481+
// we need regexps to test these!
14761482
std::io::println(expand_and_resolve_and_pretty_print(*s));
14771483
}
14781484
}

0 commit comments

Comments
 (0)