diff options
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r-- | crates/ra_mbe/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_mbe/src/mbe_expander/matcher.rs | 8 | ||||
-rw-r--r-- | crates/ra_mbe/src/subtree_source.rs | 2 | ||||
-rw-r--r-- | crates/ra_mbe/src/syntax_bridge.rs | 6 | ||||
-rw-r--r-- | crates/ra_mbe/src/tests.rs | 5 |
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] |
12 | ra_syntax = { path = "../ra_syntax" } | 12 | ra_syntax = { path = "../ra_syntax" } |
13 | ra_parser = { path = "../ra_parser" } | 13 | parser = { path = "../parser" } |
14 | tt = { path = "../tt" } | 14 | tt = { path = "../tt" } |
15 | rustc-hash = "1.1.0" | 15 | rustc-hash = "1.1.0" |
16 | smallvec = "1.2.0" | 16 | 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::{ | |||
9 | }; | 9 | }; |
10 | 10 | ||
11 | use super::ExpandResult; | 11 | use super::ExpandResult; |
12 | use ra_parser::{FragmentKind::*, TreeSink}; | 12 | use parser::{FragmentKind::*, TreeSink}; |
13 | use ra_syntax::{SmolStr, SyntaxKind}; | 13 | use ra_syntax::{SmolStr, SyntaxKind}; |
14 | use tt::buffer::{Cursor, TokenBuffer}; | 14 | use 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 | ||
3 | use ra_parser::{Token, TokenSource}; | 3 | use parser::{Token, TokenSource}; |
4 | use ra_syntax::{lex_single_syntax_kind, SmolStr, SyntaxKind, SyntaxKind::*, T}; | 4 | use ra_syntax::{lex_single_syntax_kind, SmolStr, SyntaxKind, SyntaxKind::*, T}; |
5 | use std::cell::{Cell, Ref, RefCell}; | 5 | use std::cell::{Cell, Ref, RefCell}; |
6 | use tt::buffer::{Cursor, TokenBuffer}; | 6 | 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 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use ra_parser::{FragmentKind, ParseError, TreeSink}; | 3 | use parser::{FragmentKind, ParseError, TreeSink}; |
4 | use ra_syntax::{ | 4 | use 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> { | |||
715 | mod tests { | 715 | mod 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 @@ | |||
1 | use std::fmt::Write; | 1 | use std::fmt::Write; |
2 | 2 | ||
3 | use ra_parser::FragmentKind; | 3 | use ::parser::FragmentKind; |
4 | use ra_syntax::{ast, AstNode, NodeOrToken, SyntaxKind::IDENT, SyntaxNode, WalkEvent, T}; | 4 | use ra_syntax::{ast, AstNode, NodeOrToken, SyntaxKind::IDENT, SyntaxNode, WalkEvent, T}; |
5 | use test_utils::assert_eq_text; | 5 | use test_utils::assert_eq_text; |
6 | 6 | ||
@@ -9,9 +9,10 @@ use super::*; | |||
9 | mod rule_parsing { | 9 | mod 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) { |