mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
kill utils module
This commit is contained in:
parent
9be7426aae
commit
f7f99af0a6
10 changed files with 101 additions and 114 deletions
|
@ -27,8 +27,6 @@ mod ptr;
|
|||
|
||||
pub mod algo;
|
||||
pub mod ast;
|
||||
/// Utilities for simple uses of the parser.
|
||||
pub mod utils;
|
||||
|
||||
pub use rowan::{SmolStr, TextRange, TextUnit};
|
||||
pub use ra_parser::SyntaxKind;
|
||||
|
@ -51,7 +49,7 @@ impl SourceFile {
|
|||
fn new(green: GreenNode, errors: Vec<SyntaxError>) -> TreeArc<SourceFile> {
|
||||
let root = SyntaxNode::new(green, errors);
|
||||
if cfg!(debug_assertions) {
|
||||
utils::validate_block_structure(&root);
|
||||
validation::validate_block_structure(&root);
|
||||
}
|
||||
assert_eq!(root.kind(), SyntaxKind::SOURCE_FILE);
|
||||
TreeArc::cast(root)
|
||||
|
@ -82,3 +80,10 @@ impl SourceFile {
|
|||
errors
|
||||
}
|
||||
}
|
||||
|
||||
pub fn check_fuzz_invariants(text: &str) {
|
||||
let file = SourceFile::parse(text);
|
||||
let root = file.syntax();
|
||||
validation::validate_block_structure(root);
|
||||
let _ = file.errors();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue