mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
flattern module structure
This commit is contained in:
parent
2acb21e8f7
commit
cce23fddba
5 changed files with 30 additions and 14 deletions
|
@ -20,7 +20,7 @@ use crate::{
|
|||
},
|
||||
parsing::{
|
||||
lexer::Token,
|
||||
parser_impl::TreeSink,
|
||||
TreeSink,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -113,7 +113,7 @@ impl<'a, S: TreeSink> EventProcessor<'a, S> {
|
|||
}
|
||||
|
||||
/// Generate the syntax tree with the control of events.
|
||||
pub(super) fn process(mut self) -> S {
|
||||
pub(crate) fn process(mut self) -> S {
|
||||
let mut forward_parents = Vec::new();
|
||||
|
||||
for i in 0..self.events.len() {
|
|
@ -1,8 +1,7 @@
|
|||
use crate::{
|
||||
SyntaxKind, SyntaxKind::EOF, TextRange, TextUnit,
|
||||
parsing::{
|
||||
TokenPos,
|
||||
parser_impl::TokenSource,
|
||||
TokenPos, TokenSource,
|
||||
lexer::Token,
|
||||
},
|
||||
};
|
|
@ -8,7 +8,7 @@ use crate::{
|
|||
parsing::{
|
||||
TokenSource, TokenPos,
|
||||
token_set::TokenSet,
|
||||
parser_impl::event::Event,
|
||||
event::Event,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -4,8 +4,7 @@ use crate::{
|
|||
syntax_node::{GreenNode, SyntaxNode},
|
||||
syntax_error::SyntaxError,
|
||||
parsing::{
|
||||
grammar,
|
||||
parser_impl,
|
||||
grammar, parse_with,
|
||||
builder::GreenBuilder,
|
||||
parser_api::Parser,
|
||||
lexer::{tokenize, Token},
|
||||
|
@ -62,8 +61,7 @@ fn reparse_block<'node>(
|
|||
if !is_balanced(&tokens) {
|
||||
return None;
|
||||
}
|
||||
let (green, new_errors) =
|
||||
parser_impl::parse_with(GreenBuilder::new(), &text, &tokens, reparser);
|
||||
let (green, new_errors) = parse_with(GreenBuilder::new(), &text, &tokens, reparser);
|
||||
Some((node, green, new_errors))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue