diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_syntax/src/parsing.rs | 4 | ||||
-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 |
5 files changed, 4 insertions, 29 deletions
diff --git a/crates/ra_syntax/src/parsing.rs b/crates/ra_syntax/src/parsing.rs index 5de6ff8c1..941ec501e 100644 --- a/crates/ra_syntax/src/parsing.rs +++ b/crates/ra_syntax/src/parsing.rs | |||
@@ -4,7 +4,7 @@ mod builder; | |||
4 | mod lexer; | 4 | mod lexer; |
5 | mod event; | 5 | mod event; |
6 | mod input; | 6 | mod input; |
7 | mod parser_api; | 7 | mod parser; |
8 | mod grammar; | 8 | mod grammar; |
9 | mod reparsing; | 9 | mod reparsing; |
10 | 10 | ||
@@ -14,7 +14,7 @@ use crate::{ | |||
14 | builder::GreenBuilder, | 14 | builder::GreenBuilder, |
15 | input::ParserInput, | 15 | input::ParserInput, |
16 | event::EventProcessor, | 16 | event::EventProcessor, |
17 | parser_api::Parser, | 17 | parser::Parser, |
18 | }, | 18 | }, |
19 | syntax_node::GreenNode, | 19 | syntax_node::GreenNode, |
20 | }; | 20 | }; |
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 | }; |