diff options
Diffstat (limited to 'crates/ra_syntax/src/parsing')
-rw-r--r-- | crates/ra_syntax/src/parsing/grammar.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/parsing/parser.rs (renamed from crates/ra_syntax/src/parsing/parser_api.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/src/parsing/parser_impl.rs | 25 | ||||
-rw-r--r-- | crates/ra_syntax/src/parsing/reparsing.rs | 2 |
4 files changed, 2 insertions, 27 deletions
diff --git a/crates/ra_syntax/src/parsing/grammar.rs b/crates/ra_syntax/src/parsing/grammar.rs index bcdcd9f57..7ca9c223c 100644 --- a/crates/ra_syntax/src/parsing/grammar.rs +++ b/crates/ra_syntax/src/parsing/grammar.rs | |||
@@ -41,7 +41,7 @@ use crate::{ | |||
41 | SyntaxKind::{self, *}, | 41 | SyntaxKind::{self, *}, |
42 | parsing::{ | 42 | parsing::{ |
43 | token_set::TokenSet, | 43 | token_set::TokenSet, |
44 | parser_api::{CompletedMarker, Marker, Parser} | 44 | parser::{CompletedMarker, Marker, Parser} |
45 | }, | 45 | }, |
46 | }; | 46 | }; |
47 | 47 | ||
diff --git a/crates/ra_syntax/src/parsing/parser_api.rs b/crates/ra_syntax/src/parsing/parser.rs index 988fcb518..988fcb518 100644 --- a/crates/ra_syntax/src/parsing/parser_api.rs +++ b/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 6eed0e656..000000000 --- a/crates/ra_syntax/src/parsing/parser_impl.rs +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | pub(super) mod event; | ||
2 | pub(super) mod input; | ||
3 | |||
4 | use crate::parsing::{ | ||
5 | TreeSink, TokenSource, | ||
6 | lexer::Token, | ||
7 | parser_api::Parser, | ||
8 | parser_impl::event::EventProcessor, | ||
9 | }; | ||
10 | |||
11 | /// Parse a sequence of tokens into the representative node tree | ||
12 | pub(super) fn parse_with<S: TreeSink>( | ||
13 | sink: S, | ||
14 | text: &str, | ||
15 | tokens: &[Token], | ||
16 | parser: fn(&mut Parser), | ||
17 | ) -> S::Tree { | ||
18 | let mut events = { | ||
19 | let input = input::ParserInput::new(text, tokens); | ||
20 | let mut parser_api = Parser::new(&input); | ||
21 | parser(&mut parser_api); | ||
22 | parser_api.finish() | ||
23 | }; | ||
24 | EventProcessor::new(sink, text, tokens, &mut events).process().finish() | ||
25 | } | ||
diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs index f45326dff..674b15f9a 100644 --- a/crates/ra_syntax/src/parsing/reparsing.rs +++ b/crates/ra_syntax/src/parsing/reparsing.rs | |||
@@ -6,7 +6,7 @@ use crate::{ | |||
6 | parsing::{ | 6 | parsing::{ |
7 | grammar, parse_with, | 7 | grammar, parse_with, |
8 | builder::GreenBuilder, | 8 | builder::GreenBuilder, |
9 | parser_api::Parser, | 9 | parser::Parser, |
10 | lexer::{tokenize, Token}, | 10 | lexer::{tokenize, Token}, |
11 | } | 11 | } |
12 | }; | 12 | }; |