mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Change TokenSource to iteration based
This commit is contained in:
parent
ef00b5af1c
commit
fcb1eef323
8 changed files with 174 additions and 103 deletions
|
@ -17,8 +17,8 @@ pub(crate) use self::reparsing::incremental_reparse;
|
|||
|
||||
pub(crate) fn parse_text(text: &str) -> (GreenNode, Vec<SyntaxError>) {
|
||||
let tokens = tokenize(&text);
|
||||
let token_source = text_token_source::TextTokenSource::new(text, &tokens);
|
||||
let mut token_source = text_token_source::TextTokenSource::new(text, &tokens);
|
||||
let mut tree_sink = text_tree_sink::TextTreeSink::new(text, &tokens);
|
||||
ra_parser::parse(&token_source, &mut tree_sink);
|
||||
ra_parser::parse(&mut token_source, &mut tree_sink);
|
||||
tree_sink.finish()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue