diff options
Diffstat (limited to 'crates/ra_syntax/src/parsing')
-rw-r--r-- | crates/ra_syntax/src/parsing/reparsing.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/parsing/text_token_source.rs | 14 | ||||
-rw-r--r-- | crates/ra_syntax/src/parsing/text_tree_sink.rs | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs index 6644ffca4..4149f856a 100644 --- a/crates/ra_syntax/src/parsing/reparsing.rs +++ b/crates/ra_syntax/src/parsing/reparsing.rs | |||
@@ -6,7 +6,7 @@ | |||
6 | //! - otherwise, we search for the nearest `{}` block which contains the edit | 6 | //! - otherwise, we search for the nearest `{}` block which contains the edit |
7 | //! and try to parse only this block. | 7 | //! and try to parse only this block. |
8 | 8 | ||
9 | use ra_parser::Reparser; | 9 | use parser::Reparser; |
10 | use text_edit::Indel; | 10 | use text_edit::Indel; |
11 | 11 | ||
12 | use crate::{ | 12 | use crate::{ |
diff --git a/crates/ra_syntax/src/parsing/text_token_source.rs b/crates/ra_syntax/src/parsing/text_token_source.rs index 97aa3e795..df866dc2b 100644 --- a/crates/ra_syntax/src/parsing/text_token_source.rs +++ b/crates/ra_syntax/src/parsing/text_token_source.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | //! See `TextTokenSource` docs. | 1 | //! See `TextTokenSource` docs. |
2 | 2 | ||
3 | use ra_parser::TokenSource; | 3 | use parser::TokenSource; |
4 | 4 | ||
5 | use crate::{parsing::lexer::Token, SyntaxKind::EOF, TextRange, TextSize}; | 5 | use crate::{parsing::lexer::Token, SyntaxKind::EOF, TextRange, TextSize}; |
6 | 6 | ||
7 | /// Implementation of `ra_parser::TokenSource` that takes tokens from source code text. | 7 | /// Implementation of `parser::TokenSource` that takes tokens from source code text. |
8 | pub(crate) struct TextTokenSource<'t> { | 8 | pub(crate) struct TextTokenSource<'t> { |
9 | text: &'t str, | 9 | text: &'t str, |
10 | /// token and its start position (non-whitespace/comment tokens) | 10 | /// token and its start position (non-whitespace/comment tokens) |
@@ -20,15 +20,15 @@ pub(crate) struct TextTokenSource<'t> { | |||
20 | token_offset_pairs: Vec<(Token, TextSize)>, | 20 | token_offset_pairs: Vec<(Token, TextSize)>, |
21 | 21 | ||
22 | /// Current token and position | 22 | /// Current token and position |
23 | curr: (ra_parser::Token, usize), | 23 | curr: (parser::Token, usize), |
24 | } | 24 | } |
25 | 25 | ||
26 | impl<'t> TokenSource for TextTokenSource<'t> { | 26 | impl<'t> TokenSource for TextTokenSource<'t> { |
27 | fn current(&self) -> ra_parser::Token { | 27 | fn current(&self) -> parser::Token { |
28 | self.curr.0 | 28 | self.curr.0 |
29 | } | 29 | } |
30 | 30 | ||
31 | fn lookahead_nth(&self, n: usize) -> ra_parser::Token { | 31 | fn lookahead_nth(&self, n: usize) -> parser::Token { |
32 | mk_token(self.curr.1 + n, &self.token_offset_pairs) | 32 | mk_token(self.curr.1 + n, &self.token_offset_pairs) |
33 | } | 33 | } |
34 | 34 | ||
@@ -49,7 +49,7 @@ impl<'t> TokenSource for TextTokenSource<'t> { | |||
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | fn mk_token(pos: usize, token_offset_pairs: &[(Token, TextSize)]) -> ra_parser::Token { | 52 | fn mk_token(pos: usize, token_offset_pairs: &[(Token, TextSize)]) -> parser::Token { |
53 | let (kind, is_jointed_to_next) = match token_offset_pairs.get(pos) { | 53 | let (kind, is_jointed_to_next) = match token_offset_pairs.get(pos) { |
54 | Some((token, offset)) => ( | 54 | Some((token, offset)) => ( |
55 | token.kind, | 55 | token.kind, |
@@ -60,7 +60,7 @@ fn mk_token(pos: usize, token_offset_pairs: &[(Token, TextSize)]) -> ra_parser:: | |||
60 | ), | 60 | ), |
61 | None => (EOF, false), | 61 | None => (EOF, false), |
62 | }; | 62 | }; |
63 | ra_parser::Token { kind, is_jointed_to_next } | 63 | parser::Token { kind, is_jointed_to_next } |
64 | } | 64 | } |
65 | 65 | ||
66 | impl<'t> TextTokenSource<'t> { | 66 | impl<'t> TextTokenSource<'t> { |
diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs index 6d1828d20..c1b5f246d 100644 --- a/crates/ra_syntax/src/parsing/text_tree_sink.rs +++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use std::mem; | 3 | use std::mem; |
4 | 4 | ||
5 | use ra_parser::{ParseError, TreeSink}; | 5 | use parser::{ParseError, TreeSink}; |
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | parsing::Token, | 8 | parsing::Token, |