diff --git a/crates/ra_syntax/src/parsing.rs b/crates/ra_syntax/src/parsing.rs index 5de6ff8c11..941ec501e5 100644 --- a/crates/ra_syntax/src/parsing.rs +++ b/crates/ra_syntax/src/parsing.rs @@ -4,7 +4,7 @@ mod builder; mod lexer; mod event; mod input; -mod parser_api; +mod parser; mod grammar; mod reparsing; @@ -14,7 +14,7 @@ use crate::{ builder::GreenBuilder, input::ParserInput, event::EventProcessor, - parser_api::Parser, + parser::Parser, }, syntax_node::GreenNode, }; diff --git a/crates/ra_syntax/src/parsing/grammar.rs b/crates/ra_syntax/src/parsing/grammar.rs index bcdcd9f578..7ca9c223cc 100644 --- a/crates/ra_syntax/src/parsing/grammar.rs +++ b/crates/ra_syntax/src/parsing/grammar.rs @@ -41,7 +41,7 @@ use crate::{ SyntaxKind::{self, *}, parsing::{ token_set::TokenSet, - parser_api::{CompletedMarker, Marker, Parser} + parser::{CompletedMarker, Marker, Parser} }, }; diff --git a/crates/ra_syntax/src/parsing/parser_api.rs b/crates/ra_syntax/src/parsing/parser.rs similarity index 100% rename from crates/ra_syntax/src/parsing/parser_api.rs rename to crates/ra_syntax/src/parsing/parser.rs diff --git a/crates/ra_syntax/src/parsing/parser_impl.rs b/crates/ra_syntax/src/parsing/parser_impl.rs deleted file mode 100644 index 6eed0e656a..0000000000 --- a/crates/ra_syntax/src/parsing/parser_impl.rs +++ /dev/null @@ -1,25 +0,0 @@ -pub(super) mod event; -pub(super) mod input; - -use crate::parsing::{ - TreeSink, TokenSource, - lexer::Token, - parser_api::Parser, - parser_impl::event::EventProcessor, -}; - -/// Parse a sequence of tokens into the representative node tree -pub(super) fn parse_with( - sink: S, - text: &str, - tokens: &[Token], - parser: fn(&mut Parser), -) -> S::Tree { - let mut events = { - let input = input::ParserInput::new(text, tokens); - let mut parser_api = Parser::new(&input); - parser(&mut parser_api); - parser_api.finish() - }; - EventProcessor::new(sink, text, tokens, &mut events).process().finish() -} diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs index f45326dffe..674b15f9a2 100644 --- a/crates/ra_syntax/src/parsing/reparsing.rs +++ b/crates/ra_syntax/src/parsing/reparsing.rs @@ -6,7 +6,7 @@ use crate::{ parsing::{ grammar, parse_with, builder::GreenBuilder, - parser_api::Parser, + parser::Parser, lexer::{tokenize, Token}, } };