aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-08-12 16:06:49 +0100
committerAleksey Kladov <[email protected]>2020-08-12 16:14:23 +0100
commit50a02eb3593591a02677e1b56f24d7ff0459b9d0 (patch)
treea17351b1e3addea0a719f38990fea9289b6ef65e /crates/ra_mbe
parent6dafc13f5f776980cd2560fb79d3d4790811c96d (diff)
Rename ra_parser -> parser
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r--crates/ra_mbe/Cargo.toml2
-rw-r--r--crates/ra_mbe/src/mbe_expander/matcher.rs8
-rw-r--r--crates/ra_mbe/src/subtree_source.rs2
-rw-r--r--crates/ra_mbe/src/syntax_bridge.rs6
-rw-r--r--crates/ra_mbe/src/tests.rs5
5 files changed, 12 insertions, 11 deletions
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
10 10
11[dependencies] 11[dependencies]
12ra_syntax = { path = "../ra_syntax" } 12ra_syntax = { path = "../ra_syntax" }
13ra_parser = { path = "../ra_parser" } 13parser = { path = "../parser" }
14tt = { path = "../tt" } 14tt = { path = "../tt" }
15rustc-hash = "1.1.0" 15rustc-hash = "1.1.0"
16smallvec = "1.2.0" 16smallvec = "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::{
9}; 9};
10 10
11use super::ExpandResult; 11use super::ExpandResult;
12use ra_parser::{FragmentKind::*, TreeSink}; 12use parser::{FragmentKind::*, TreeSink};
13use ra_syntax::{SmolStr, SyntaxKind}; 13use ra_syntax::{SmolStr, SyntaxKind};
14use tt::buffer::{Cursor, TokenBuffer}; 14use tt::buffer::{Cursor, TokenBuffer};
15 15
@@ -285,7 +285,7 @@ impl<'a> TtIter<'a> {
285 285
286 pub(crate) fn expect_fragment( 286 pub(crate) fn expect_fragment(
287 &mut self, 287 &mut self,
288 fragment_kind: ra_parser::FragmentKind, 288 fragment_kind: parser::FragmentKind,
289 ) -> ExpandResult<Option<tt::TokenTree>> { 289 ) -> ExpandResult<Option<tt::TokenTree>> {
290 pub(crate) struct OffsetTokenSink<'a> { 290 pub(crate) struct OffsetTokenSink<'a> {
291 pub(crate) cursor: Cursor<'a>, 291 pub(crate) cursor: Cursor<'a>,
@@ -303,7 +303,7 @@ impl<'a> TtIter<'a> {
303 } 303 }
304 fn start_node(&mut self, _kind: SyntaxKind) {} 304 fn start_node(&mut self, _kind: SyntaxKind) {}
305 fn finish_node(&mut self) {} 305 fn finish_node(&mut self) {}
306 fn error(&mut self, _error: ra_parser::ParseError) { 306 fn error(&mut self, _error: parser::ParseError) {
307 self.error = true; 307 self.error = true;
308 } 308 }
309 } 309 }
@@ -312,7 +312,7 @@ impl<'a> TtIter<'a> {
312 let mut src = SubtreeTokenSource::new(&buffer); 312 let mut src = SubtreeTokenSource::new(&buffer);
313 let mut sink = OffsetTokenSink { cursor: buffer.begin(), error: false }; 313 let mut sink = OffsetTokenSink { cursor: buffer.begin(), error: false };
314 314
315 ra_parser::parse_fragment(&mut src, &mut sink, fragment_kind); 315 parser::parse_fragment(&mut src, &mut sink, fragment_kind);
316 316
317 let mut err = None; 317 let mut err = None;
318 if !sink.cursor.is_root() || sink.error { 318 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 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use ra_parser::{Token, TokenSource}; 3use parser::{Token, TokenSource};
4use ra_syntax::{lex_single_syntax_kind, SmolStr, SyntaxKind, SyntaxKind::*, T}; 4use ra_syntax::{lex_single_syntax_kind, SmolStr, SyntaxKind, SyntaxKind::*, T};
5use std::cell::{Cell, Ref, RefCell}; 5use std::cell::{Cell, Ref, RefCell};
6use tt::buffer::{Cursor, TokenBuffer}; 6use 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 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use ra_parser::{FragmentKind, ParseError, TreeSink}; 3use parser::{FragmentKind, ParseError, TreeSink};
4use ra_syntax::{ 4use ra_syntax::{
5 ast::{self, make::tokens::doc_comment}, 5 ast::{self, make::tokens::doc_comment},
6 tokenize, AstToken, Parse, SmolStr, SyntaxKind, 6 tokenize, AstToken, Parse, SmolStr, SyntaxKind,
@@ -81,7 +81,7 @@ pub fn token_tree_to_syntax_node(
81 let buffer = TokenBuffer::new(&tokens); 81 let buffer = TokenBuffer::new(&tokens);
82 let mut token_source = SubtreeTokenSource::new(&buffer); 82 let mut token_source = SubtreeTokenSource::new(&buffer);
83 let mut tree_sink = TtTreeSink::new(buffer.begin()); 83 let mut tree_sink = TtTreeSink::new(buffer.begin());
84 ra_parser::parse_fragment(&mut token_source, &mut tree_sink, fragment_kind); 84 parser::parse_fragment(&mut token_source, &mut tree_sink, fragment_kind);
85 if tree_sink.roots.len() != 1 { 85 if tree_sink.roots.len() != 1 {
86 return Err(ExpandError::ConversionError); 86 return Err(ExpandError::ConversionError);
87 } 87 }
@@ -715,7 +715,7 @@ impl<'a> TreeSink for TtTreeSink<'a> {
715mod tests { 715mod tests {
716 use super::*; 716 use super::*;
717 use crate::tests::parse_macro; 717 use crate::tests::parse_macro;
718 use ra_parser::TokenSource; 718 use parser::TokenSource;
719 use ra_syntax::{ 719 use ra_syntax::{
720 algo::{insert_children, InsertPosition}, 720 algo::{insert_children, InsertPosition},
721 ast::AstNode, 721 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 @@
1use std::fmt::Write; 1use std::fmt::Write;
2 2
3use ra_parser::FragmentKind; 3use ::parser::FragmentKind;
4use ra_syntax::{ast, AstNode, NodeOrToken, SyntaxKind::IDENT, SyntaxNode, WalkEvent, T}; 4use ra_syntax::{ast, AstNode, NodeOrToken, SyntaxKind::IDENT, SyntaxNode, WalkEvent, T};
5use test_utils::assert_eq_text; 5use test_utils::assert_eq_text;
6 6
@@ -9,9 +9,10 @@ use super::*;
9mod rule_parsing { 9mod rule_parsing {
10 use ra_syntax::{ast, AstNode}; 10 use ra_syntax::{ast, AstNode};
11 11
12 use super::*;
13 use crate::ast_to_token_tree; 12 use crate::ast_to_token_tree;
14 13
14 use super::*;
15
15 #[test] 16 #[test]
16 fn test_valid_arms() { 17 fn test_valid_arms() {
17 fn check(macro_body: &str) { 18 fn check(macro_body: &str) {