kill utils module

This commit is contained in:
Aleksey Kladov 2019-02-21 15:51:22 +03:00
parent 9be7426aae
commit f7f99af0a6
10 changed files with 101 additions and 114 deletions

View file

@ -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();
}