mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
grand module rename
This commit is contained in:
parent
93c0b7d794
commit
4cbc902fcc
15 changed files with 0 additions and 0 deletions
24
crates/ra_syntax/src/validation.rs
Normal file
24
crates/ra_syntax/src/validation.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
use crate::{
|
||||
algo::visit::{visitor_ctx, VisitorCtx},
|
||||
ast,
|
||||
SourceFileNode,
|
||||
yellow::SyntaxError,
|
||||
};
|
||||
|
||||
mod byte;
|
||||
mod byte_string;
|
||||
mod char;
|
||||
mod string;
|
||||
|
||||
pub(crate) fn validate(file: &SourceFileNode) -> Vec<SyntaxError> {
|
||||
let mut errors = Vec::new();
|
||||
for node in file.syntax().descendants() {
|
||||
let _ = visitor_ctx(&mut errors)
|
||||
.visit::<ast::Byte, _>(self::byte::validate_byte_node)
|
||||
.visit::<ast::ByteString, _>(self::byte_string::validate_byte_string_node)
|
||||
.visit::<ast::Char, _>(self::char::validate_char_node)
|
||||
.visit::<ast::String, _>(self::string::validate_string_node)
|
||||
.accept(node);
|
||||
}
|
||||
errors
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue