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_mbe/Cargo.toml | 2 +- crates/ra_mbe/src/mbe_expander/matcher.rs | 8 ++++---- crates/ra_mbe/src/subtree_source.rs | 2 +- crates/ra_mbe/src/syntax_bridge.rs | 6 +++--- crates/ra_mbe/src/tests.rs | 5 +++-- 5 files changed, 12 insertions(+), 11 deletions(-) (limited to 'crates/ra_mbe') diff --git a/crates/ra_mbe/Cargo.toml b/crates/ra_mbe/Cargo.toml index 23315910c..e518f73e3 100644 --- a/crates/ra_mbe/Cargo.toml +++ b/crates/ra_mbe/Cargo.toml @@ -10,7 +10,7 @@ doctest = false [dependencies] ra_syntax = { path = "../ra_syntax" } -ra_parser = { path = "../ra_parser" } +parser = { path = "../parser" } tt = { path = "../tt" } rustc-hash = "1.1.0" smallvec = "1.2.0" diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/ra_mbe/src/mbe_expander/matcher.rs index 933a3a3b5..c752804b2 100644 --- a/crates/ra_mbe/src/mbe_expander/matcher.rs +++ b/crates/ra_mbe/src/mbe_expander/matcher.rs @@ -9,7 +9,7 @@ use crate::{ }; use super::ExpandResult; -use ra_parser::{FragmentKind::*, TreeSink}; +use parser::{FragmentKind::*, TreeSink}; use ra_syntax::{SmolStr, SyntaxKind}; use tt::buffer::{Cursor, TokenBuffer}; @@ -285,7 +285,7 @@ impl<'a> TtIter<'a> { pub(crate) fn expect_fragment( &mut self, - fragment_kind: ra_parser::FragmentKind, + fragment_kind: parser::FragmentKind, ) -> ExpandResult> { pub(crate) struct OffsetTokenSink<'a> { pub(crate) cursor: Cursor<'a>, @@ -303,7 +303,7 @@ impl<'a> TtIter<'a> { } fn start_node(&mut self, _kind: SyntaxKind) {} fn finish_node(&mut self) {} - fn error(&mut self, _error: ra_parser::ParseError) { + fn error(&mut self, _error: parser::ParseError) { self.error = true; } } @@ -312,7 +312,7 @@ impl<'a> TtIter<'a> { let mut src = SubtreeTokenSource::new(&buffer); let mut sink = OffsetTokenSink { cursor: buffer.begin(), error: false }; - ra_parser::parse_fragment(&mut src, &mut sink, fragment_kind); + parser::parse_fragment(&mut src, &mut sink, fragment_kind); let mut err = None; if !sink.cursor.is_root() || sink.error { diff --git a/crates/ra_mbe/src/subtree_source.rs b/crates/ra_mbe/src/subtree_source.rs index d7866452d..1a1cb08cf 100644 --- a/crates/ra_mbe/src/subtree_source.rs +++ b/crates/ra_mbe/src/subtree_source.rs @@ -1,6 +1,6 @@ //! FIXME: write short doc here -use ra_parser::{Token, TokenSource}; +use parser::{Token, TokenSource}; use ra_syntax::{lex_single_syntax_kind, SmolStr, SyntaxKind, SyntaxKind::*, T}; use std::cell::{Cell, Ref, RefCell}; use tt::buffer::{Cursor, TokenBuffer}; diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index 5fc48507f..7b9c88ae6 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs @@ -1,6 +1,6 @@ //! FIXME: write short doc here -use ra_parser::{FragmentKind, ParseError, TreeSink}; +use parser::{FragmentKind, ParseError, TreeSink}; use ra_syntax::{ ast::{self, make::tokens::doc_comment}, tokenize, AstToken, Parse, SmolStr, SyntaxKind, @@ -81,7 +81,7 @@ pub fn token_tree_to_syntax_node( let buffer = TokenBuffer::new(&tokens); let mut token_source = SubtreeTokenSource::new(&buffer); let mut tree_sink = TtTreeSink::new(buffer.begin()); - ra_parser::parse_fragment(&mut token_source, &mut tree_sink, fragment_kind); + parser::parse_fragment(&mut token_source, &mut tree_sink, fragment_kind); if tree_sink.roots.len() != 1 { return Err(ExpandError::ConversionError); } @@ -715,7 +715,7 @@ impl<'a> TreeSink for TtTreeSink<'a> { mod tests { use super::*; use crate::tests::parse_macro; - use ra_parser::TokenSource; + use parser::TokenSource; use ra_syntax::{ algo::{insert_children, InsertPosition}, ast::AstNode, diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index 286983d60..be39b0e45 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs @@ -1,6 +1,6 @@ use std::fmt::Write; -use ra_parser::FragmentKind; +use ::parser::FragmentKind; use ra_syntax::{ast, AstNode, NodeOrToken, SyntaxKind::IDENT, SyntaxNode, WalkEvent, T}; use test_utils::assert_eq_text; @@ -9,9 +9,10 @@ use super::*; mod rule_parsing { use ra_syntax::{ast, AstNode}; - use super::*; use crate::ast_to_token_tree; + use super::*; + #[test] fn test_valid_arms() { fn check(macro_body: &str) { -- cgit v1.2.3