kill utils module
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user