Skip to content

Commit 244d616

Browse files
committed
---
yaml --- r: 152846 b: refs/heads/try2 c: 19e1d83 h: refs/heads/master v: v3
1 parent 83f0831 commit 244d616

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 9215d7e5b764c173ef8b2fecda913d39291e378b
8+
refs/heads/try2: 19e1d834ffad4c5023a44f894d570054913e31e8
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)