From 50a02eb3593591a02677e1b56f24d7ff0459b9d0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 17:06:49 +0200 Subject: Rename ra_parser -> parser --- crates/ra_syntax/src/parsing/reparsing.rs | 2 +- crates/ra_syntax/src/parsing/text_token_source.rs | 14 +++++++------- crates/ra_syntax/src/parsing/text_tree_sink.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'crates/ra_syntax/src/parsing') 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 @@ //! - otherwise, we search for the nearest `{}` block which contains the edit //! and try to parse only this block. -use ra_parser::Reparser; +use parser::Reparser; use text_edit::Indel; 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 @@ //! See `TextTokenSource` docs. -use ra_parser::TokenSource; +use parser::TokenSource; use crate::{parsing::lexer::Token, SyntaxKind::EOF, TextRange, TextSize}; -/// Implementation of `ra_parser::TokenSource` that takes tokens from source code text. +/// Implementation of `parser::TokenSource` that takes tokens from source code text. pub(crate) struct TextTokenSource<'t> { text: &'t str, /// token and its start position (non-whitespace/comment tokens) @@ -20,15 +20,15 @@ pub(crate) struct TextTokenSource<'t> { token_offset_pairs: Vec<(Token, TextSize)>, /// Current token and position - curr: (ra_parser::Token, usize), + curr: (parser::Token, usize), } impl<'t> TokenSource for TextTokenSource<'t> { - fn current(&self) -> ra_parser::Token { + fn current(&self) -> parser::Token { self.curr.0 } - fn lookahead_nth(&self, n: usize) -> ra_parser::Token { + fn lookahead_nth(&self, n: usize) -> parser::Token { mk_token(self.curr.1 + n, &self.token_offset_pairs) } @@ -49,7 +49,7 @@ impl<'t> TokenSource for TextTokenSource<'t> { } } -fn mk_token(pos: usize, token_offset_pairs: &[(Token, TextSize)]) -> ra_parser::Token { +fn mk_token(pos: usize, token_offset_pairs: &[(Token, TextSize)]) -> parser::Token { let (kind, is_jointed_to_next) = match token_offset_pairs.get(pos) { Some((token, offset)) => ( token.kind, @@ -60,7 +60,7 @@ fn mk_token(pos: usize, token_offset_pairs: &[(Token, TextSize)]) -> ra_parser:: ), None => (EOF, false), }; - ra_parser::Token { kind, is_jointed_to_next } + parser::Token { kind, is_jointed_to_next } } 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 @@ use std::mem; -use ra_parser::{ParseError, TreeSink}; +use parser::{ParseError, TreeSink}; use crate::{ parsing::Token, -- cgit v1.2.3