Skip to content

Commit cae0472

Browse files
committed
---
yaml --- r: 121485 b: refs/heads/master c: 19e1d83 h: refs/heads/master i: 121483: a7e14d4 v: v3
1 parent c9972b2 commit cae0472

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,5 +1,5 @@
11
---
2-
refs/heads/master: 9215d7e5b764c173ef8b2fecda913d39291e378b
2+
refs/heads/master: 19e1d834ffad4c5023a44f894d570054913e31e8
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: bab614f5fa725d248afc5f0530c835f37998ce8f
55
refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f

trunk/src/libsyntax/ext/expand.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,13 +1406,19 @@ foo_module!()
14061406
strs_to_idents(vec!("a","c","b","d")));
14071407
}
14081408

1409+
// test the list of identifier patterns gathered by the visitor. Note that
1410+
// 'None' is listed as an identifier pattern because we don't yet know that
1411+
// it's the name of a 0-ary variant, and that 'i' appears twice in succession.
14091412
#[test]
1410-
fn pat_idents_2(){
1411-
let the_crate = string_to_crate("fn main (a : int) -> int {|b| {a + b} }".to_string());
1412-
let mut pat_idents = new_name_finder(Vec::new());
1413-
pat_idents.visit_mod(&the_crate.module, the_crate.span, ast::CRATE_NODE_ID, ());
1414-
assert_eq!(pat_idents.ident_accumulator,
1415-
strs_to_idents(vec!("a","b")));
1413+
fn crate_idents(){
1414+
let the_crate = string_to_crate("fn main (a : int) -> int {|b| {
1415+
match 34 {None => 3, Some(i) | i => j, Foo{k:z,l:y} => \"banana\"}} }".to_string());
1416+
let mut idents = new_name_finder(Vec::new());
1417+
//visit::walk_crate(&mut idents, &the_crate, ());
1418+
idents.visit_mod(&the_crate.module, the_crate.span, ast::CRATE_NODE_ID, ());
1419+
assert_eq!(idents.ident_accumulator,
1420+
strs_to_idents(vec!("a","b","None","i","i","z","y")));
14161421
}
14171422

1423+
14181424
}

0 commit comments

Comments
 (0)