diff options
Diffstat (limited to 'crates/ra_syntax/src/fuzz.rs')
-rw-r--r-- | crates/ra_syntax/src/fuzz.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_syntax/src/fuzz.rs b/crates/ra_syntax/src/fuzz.rs index 00039f970..716925b2f 100644 --- a/crates/ra_syntax/src/fuzz.rs +++ b/crates/ra_syntax/src/fuzz.rs | |||
@@ -9,7 +9,7 @@ fn check_file_invariants(file: &SourceFile) { | |||
9 | 9 | ||
10 | pub fn check_parser(text: &str) { | 10 | pub fn check_parser(text: &str) { |
11 | let file = SourceFile::parse(text); | 11 | let file = SourceFile::parse(text); |
12 | check_file_invariants(&file.tree); | 12 | check_file_invariants(&file.tree()); |
13 | } | 13 | } |
14 | 14 | ||
15 | #[derive(Debug, Clone)] | 15 | #[derive(Debug, Clone)] |
@@ -45,16 +45,16 @@ impl CheckReparse { | |||
45 | pub fn run(&self) { | 45 | pub fn run(&self) { |
46 | let parse = SourceFile::parse(&self.text); | 46 | let parse = SourceFile::parse(&self.text); |
47 | let new_parse = parse.reparse(&self.edit); | 47 | let new_parse = parse.reparse(&self.edit); |
48 | check_file_invariants(&new_parse.tree); | 48 | check_file_invariants(&new_parse.tree()); |
49 | assert_eq!(&new_parse.tree.syntax().text().to_string(), &self.edited_text); | 49 | assert_eq!(&new_parse.tree().syntax().text().to_string(), &self.edited_text); |
50 | let full_reparse = SourceFile::parse(&self.edited_text); | 50 | let full_reparse = SourceFile::parse(&self.edited_text); |
51 | for (a, b) in | 51 | for (a, b) in |
52 | new_parse.tree.syntax().descendants().zip(full_reparse.tree.syntax().descendants()) | 52 | new_parse.tree().syntax().descendants().zip(full_reparse.tree().syntax().descendants()) |
53 | { | 53 | { |
54 | if (a.kind(), a.range()) != (b.kind(), b.range()) { | 54 | if (a.kind(), a.range()) != (b.kind(), b.range()) { |
55 | eprint!("original:\n{}", parse.tree.syntax().debug_dump()); | 55 | eprint!("original:\n{}", parse.tree().syntax().debug_dump()); |
56 | eprint!("reparsed:\n{}", new_parse.tree.syntax().debug_dump()); | 56 | eprint!("reparsed:\n{}", new_parse.tree().syntax().debug_dump()); |
57 | eprint!("full reparse:\n{}", full_reparse.tree.syntax().debug_dump()); | 57 | eprint!("full reparse:\n{}", full_reparse.tree().syntax().debug_dump()); |
58 | assert_eq!( | 58 | assert_eq!( |
59 | format!("{:?}", a), | 59 | format!("{:?}", a), |
60 | format!("{:?}", b), | 60 | format!("{:?}", b), |