aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/parsing
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/parsing')
-rw-r--r--crates/ra_syntax/src/parsing/reparsing.rs2
-rw-r--r--crates/ra_syntax/src/parsing/text_token_source.rs14
-rw-r--r--crates/ra_syntax/src/parsing/text_tree_sink.rs2
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
9use ra_parser::Reparser; 9use parser::Reparser;
10use text_edit::Indel; 10use text_edit::Indel;
11 11
12use crate::{ 12use 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
3use ra_parser::TokenSource; 3use parser::TokenSource;
4 4
5use crate::{parsing::lexer::Token, SyntaxKind::EOF, TextRange, TextSize}; 5use 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.
8pub(crate) struct TextTokenSource<'t> { 8pub(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
26impl<'t> TokenSource for TextTokenSource<'t> { 26impl<'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
52fn mk_token(pos: usize, token_offset_pairs: &[(Token, TextSize)]) -> ra_parser::Token { 52fn 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
66impl<'t> TextTokenSource<'t> { 66impl<'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
3use std::mem; 3use std::mem;
4 4
5use ra_parser::{ParseError, TreeSink}; 5use parser::{ParseError, TreeSink};
6 6
7use crate::{ 7use crate::{
8 parsing::Token, 8 parsing::Token,