mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
flatten modules
This commit is contained in:
parent
9f6883fbf1
commit
a4a1e08ab8
15 changed files with 37 additions and 40 deletions
|
@ -26,12 +26,16 @@ pub mod utils;
|
|||
mod validation;
|
||||
mod syntax_node;
|
||||
mod ptr;
|
||||
mod syntax_error;
|
||||
mod syntax_text;
|
||||
|
||||
pub use rowan::{SmolStr, TextRange, TextUnit};
|
||||
pub use crate::{
|
||||
ast::AstNode,
|
||||
syntax_kinds::SyntaxKind,
|
||||
syntax_node::{Direction, SyntaxError, SyntaxNode, WalkEvent, Location, TreeArc},
|
||||
syntax_error::{SyntaxError, SyntaxErrorKind, Location},
|
||||
syntax_text::SyntaxText,
|
||||
syntax_node::{Direction, SyntaxNode, WalkEvent, TreeArc},
|
||||
ptr::{SyntaxNodePtr, AstPtr},
|
||||
parsing::{tokenize, Token},
|
||||
};
|
||||
|
|
|
@ -8,8 +8,9 @@ mod reparsing;
|
|||
mod grammar;
|
||||
|
||||
use crate::{
|
||||
SyntaxError,
|
||||
parsing::builder::GreenBuilder,
|
||||
syntax_node::{GreenNode, SyntaxError},
|
||||
syntax_node::GreenNode,
|
||||
};
|
||||
|
||||
pub use self::lexer::{tokenize, Token};
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
use crate::{
|
||||
parsing::parser_impl::Sink,
|
||||
syntax_node::{GreenNode, RaTypes, SyntaxError},
|
||||
SmolStr, SyntaxKind,
|
||||
syntax_node::{GreenNode, RaTypes},
|
||||
SmolStr, SyntaxKind, SyntaxError,
|
||||
};
|
||||
|
||||
use rowan::GreenNodeBuilder;
|
||||
|
||||
pub(crate) struct GreenBuilder {
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::cell::Cell;
|
|||
|
||||
use crate::{
|
||||
SmolStr,
|
||||
syntax_node::syntax_error::{ParseError, SyntaxError},
|
||||
syntax_error::{ParseError, SyntaxError},
|
||||
parsing::{
|
||||
lexer::Token,
|
||||
parser_api::Parser,
|
||||
|
@ -13,7 +13,8 @@ use crate::{
|
|||
event::{Event, EventProcessor},
|
||||
input::{InputPosition, ParserInput},
|
||||
},
|
||||
}};
|
||||
},
|
||||
};
|
||||
|
||||
use crate::SyntaxKind::{self, EOF, TOMBSTONE};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use crate::{
|
|||
SmolStr,
|
||||
SyntaxKind::{self, *},
|
||||
TextRange, TextUnit,
|
||||
syntax_node::syntax_error::{
|
||||
syntax_error::{
|
||||
ParseError,
|
||||
SyntaxError,
|
||||
SyntaxErrorKind,
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
use crate::{
|
||||
SyntaxKind::*, TextRange, TextUnit,
|
||||
algo,
|
||||
syntax_node::{GreenNode, SyntaxError, SyntaxNode},
|
||||
syntax_node::{GreenNode, SyntaxNode},
|
||||
syntax_error::SyntaxError,
|
||||
parsing::{
|
||||
grammar,
|
||||
parser_impl,
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
pub mod syntax_error;
|
||||
mod syntax_text;
|
||||
|
||||
use std::{fmt, borrow::Borrow};
|
||||
|
||||
use self::syntax_text::SyntaxText;
|
||||
use crate::{SmolStr, SyntaxKind, TextRange};
|
||||
use rowan::{Types, TransparentNewType};
|
||||
|
||||
pub use self::syntax_error::{SyntaxError, SyntaxErrorKind, Location};
|
||||
use crate::{
|
||||
SmolStr, SyntaxKind, TextRange, SyntaxText,
|
||||
syntax_error::SyntaxError,
|
||||
};
|
||||
|
||||
pub use rowan::WalkEvent;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
|
@ -5,7 +5,7 @@ mod string;
|
|||
mod block;
|
||||
|
||||
use crate::{
|
||||
SourceFile, syntax_node::SyntaxError, AstNode,
|
||||
SourceFile, SyntaxError, AstNode,
|
||||
ast,
|
||||
algo::visit::{visitor_ctx, VisitorCtx},
|
||||
};
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
use crate::{SyntaxKind::*,
|
||||
ast::{self, AttrsOwner, AstNode},
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
};
|
||||
|
||||
pub(crate) fn validate_block_node(node: &ast::Block, errors: &mut Vec<SyntaxError>) {
|
||||
|
|
|
@ -5,10 +5,8 @@ use crate::{
|
|||
string_lexing::{self, StringComponentKind},
|
||||
TextRange,
|
||||
validation::char,
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
};
|
||||
|
||||
pub(super) fn validate_byte_node(node: &ast::Byte, errors: &mut Vec<SyntaxError>) {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
use crate::{
|
||||
ast::{self, AstNode, AstToken},
|
||||
string_lexing::{self, StringComponentKind},
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
};
|
||||
|
||||
use super::byte;
|
||||
|
|
|
@ -8,10 +8,8 @@ use crate::{
|
|||
ast::{self, AstNode, AstToken},
|
||||
string_lexing::{self, StringComponentKind},
|
||||
TextRange,
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
};
|
||||
|
||||
pub(super) fn validate_char_node(node: &ast::Char, errors: &mut Vec<SyntaxError>) {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
use crate::{
|
||||
ast::{self, AstNode, AstToken},
|
||||
string_lexing,
|
||||
syntax_node::{
|
||||
SyntaxError,
|
||||
SyntaxErrorKind::*,
|
||||
},
|
||||
};
|
||||
|
||||
use super::char;
|
||||
|
|
Loading…
Reference in a new issue