aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-08-12 17:26:51 +0100
committerAleksey Kladov <[email protected]>2020-08-12 17:30:53 +0100
commita1c187eef3ba08076aedb5154929f7eda8d1b424 (patch)
tree9d898eb9600b0c36a74e4f95238f679c683fa566 /crates/ra_mbe
parent3d6889cba72a9d02199f7adaa2ecc69bc30af834 (diff)
Rename ra_syntax -> syntax
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r--crates/ra_mbe/Cargo.toml2
-rw-r--r--crates/ra_mbe/src/mbe_expander.rs4
-rw-r--r--crates/ra_mbe/src/mbe_expander/matcher.rs2
-rw-r--r--crates/ra_mbe/src/mbe_expander/transcriber.rs2
-rw-r--r--crates/ra_mbe/src/parser.rs2
-rw-r--r--crates/ra_mbe/src/subtree_source.rs2
-rw-r--r--crates/ra_mbe/src/syntax_bridge.rs8
-rw-r--r--crates/ra_mbe/src/tests.rs8
8 files changed, 15 insertions, 15 deletions
diff --git a/crates/ra_mbe/Cargo.toml b/crates/ra_mbe/Cargo.toml
index e518f73e3..4a4be65eb 100644
--- a/crates/ra_mbe/Cargo.toml
+++ b/crates/ra_mbe/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
9doctest = false 9doctest = false
10 10
11[dependencies] 11[dependencies]
12ra_syntax = { path = "../ra_syntax" } 12syntax = { path = "../syntax" }
13parser = { path = "../parser" } 13parser = { path = "../parser" }
14tt = { path = "../tt" } 14tt = { path = "../tt" }
15rustc-hash = "1.1.0" 15rustc-hash = "1.1.0"
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs
index b1eacf124..1ad8b9f8a 100644
--- a/crates/ra_mbe/src/mbe_expander.rs
+++ b/crates/ra_mbe/src/mbe_expander.rs
@@ -5,8 +5,8 @@
5mod matcher; 5mod matcher;
6mod transcriber; 6mod transcriber;
7 7
8use ra_syntax::SmolStr;
9use rustc_hash::FxHashMap; 8use rustc_hash::FxHashMap;
9use syntax::SmolStr;
10 10
11use crate::{ExpandError, ExpandResult}; 11use crate::{ExpandError, ExpandResult};
12 12
@@ -123,7 +123,7 @@ enum Fragment {
123 123
124#[cfg(test)] 124#[cfg(test)]
125mod tests { 125mod tests {
126 use ra_syntax::{ast, AstNode}; 126 use syntax::{ast, AstNode};
127 127
128 use super::*; 128 use super::*;
129 use crate::ast_to_token_tree; 129 use crate::ast_to_token_tree;
diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/ra_mbe/src/mbe_expander/matcher.rs
index c752804b2..b698b9832 100644
--- a/crates/ra_mbe/src/mbe_expander/matcher.rs
+++ b/crates/ra_mbe/src/mbe_expander/matcher.rs
@@ -10,7 +10,7 @@ use crate::{
10 10
11use super::ExpandResult; 11use super::ExpandResult;
12use parser::{FragmentKind::*, TreeSink}; 12use parser::{FragmentKind::*, TreeSink};
13use ra_syntax::{SmolStr, SyntaxKind}; 13use syntax::{SmolStr, SyntaxKind};
14use tt::buffer::{Cursor, TokenBuffer}; 14use tt::buffer::{Cursor, TokenBuffer};
15 15
16impl Bindings { 16impl Bindings {
diff --git a/crates/ra_mbe/src/mbe_expander/transcriber.rs b/crates/ra_mbe/src/mbe_expander/transcriber.rs
index 7c9bb4d00..c9525c5bf 100644
--- a/crates/ra_mbe/src/mbe_expander/transcriber.rs
+++ b/crates/ra_mbe/src/mbe_expander/transcriber.rs
@@ -1,7 +1,7 @@
1//! Transcriber takes a template, like `fn $ident() {}`, a set of bindings like 1//! Transcriber takes a template, like `fn $ident() {}`, a set of bindings like
2//! `$ident => foo`, interpolates variables in the template, to get `fn foo() {}` 2//! `$ident => foo`, interpolates variables in the template, to get `fn foo() {}`
3 3
4use ra_syntax::SmolStr; 4use syntax::SmolStr;
5 5
6use super::ExpandResult; 6use super::ExpandResult;
7use crate::{ 7use crate::{
diff --git a/crates/ra_mbe/src/parser.rs b/crates/ra_mbe/src/parser.rs
index 1e5dafbdf..6b46a1673 100644
--- a/crates/ra_mbe/src/parser.rs
+++ b/crates/ra_mbe/src/parser.rs
@@ -1,8 +1,8 @@
1//! Parser recognizes special macro syntax, `$var` and `$(repeat)*`, in token 1//! Parser recognizes special macro syntax, `$var` and `$(repeat)*`, in token
2//! trees. 2//! trees.
3 3
4use ra_syntax::SmolStr;
5use smallvec::SmallVec; 4use smallvec::SmallVec;
5use syntax::SmolStr;
6 6
7use crate::{tt_iter::TtIter, ExpandError}; 7use crate::{tt_iter::TtIter, ExpandError};
8 8
diff --git a/crates/ra_mbe/src/subtree_source.rs b/crates/ra_mbe/src/subtree_source.rs
index 1a1cb08cf..41461b315 100644
--- a/crates/ra_mbe/src/subtree_source.rs
+++ b/crates/ra_mbe/src/subtree_source.rs
@@ -1,8 +1,8 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use parser::{Token, TokenSource}; 3use parser::{Token, TokenSource};
4use ra_syntax::{lex_single_syntax_kind, SmolStr, SyntaxKind, SyntaxKind::*, T};
5use std::cell::{Cell, Ref, RefCell}; 4use std::cell::{Cell, Ref, RefCell};
5use syntax::{lex_single_syntax_kind, SmolStr, SyntaxKind, SyntaxKind::*, T};
6use tt::buffer::{Cursor, TokenBuffer}; 6use tt::buffer::{Cursor, TokenBuffer};
7 7
8#[derive(Debug, Clone, Eq, PartialEq)] 8#[derive(Debug, Clone, Eq, PartialEq)]
diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs
index 7b9c88ae6..a8ad917fb 100644
--- a/crates/ra_mbe/src/syntax_bridge.rs
+++ b/crates/ra_mbe/src/syntax_bridge.rs
@@ -1,13 +1,13 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use parser::{FragmentKind, ParseError, TreeSink}; 3use parser::{FragmentKind, ParseError, TreeSink};
4use ra_syntax::{ 4use rustc_hash::FxHashMap;
5use syntax::{
5 ast::{self, make::tokens::doc_comment}, 6 ast::{self, make::tokens::doc_comment},
6 tokenize, AstToken, Parse, SmolStr, SyntaxKind, 7 tokenize, AstToken, Parse, SmolStr, SyntaxKind,
7 SyntaxKind::*, 8 SyntaxKind::*,
8 SyntaxNode, SyntaxToken, SyntaxTreeBuilder, TextRange, TextSize, Token as RawToken, T, 9 SyntaxNode, SyntaxToken, SyntaxTreeBuilder, TextRange, TextSize, Token as RawToken, T,
9}; 10};
10use rustc_hash::FxHashMap;
11use tt::buffer::{Cursor, TokenBuffer}; 11use tt::buffer::{Cursor, TokenBuffer};
12 12
13use crate::subtree_source::SubtreeTokenSource; 13use crate::subtree_source::SubtreeTokenSource;
@@ -176,7 +176,7 @@ fn doc_comment_text(comment: &ast::Comment) -> SmolStr {
176 text.into() 176 text.into()
177} 177}
178 178
179fn convert_doc_comment(token: &ra_syntax::SyntaxToken) -> Option<Vec<tt::TokenTree>> { 179fn convert_doc_comment(token: &syntax::SyntaxToken) -> Option<Vec<tt::TokenTree>> {
180 let comment = ast::Comment::cast(token.clone())?; 180 let comment = ast::Comment::cast(token.clone())?;
181 let doc = comment.kind().doc?; 181 let doc = comment.kind().doc?;
182 182
@@ -716,7 +716,7 @@ mod tests {
716 use super::*; 716 use super::*;
717 use crate::tests::parse_macro; 717 use crate::tests::parse_macro;
718 use parser::TokenSource; 718 use parser::TokenSource;
719 use ra_syntax::{ 719 use syntax::{
720 algo::{insert_children, InsertPosition}, 720 algo::{insert_children, InsertPosition},
721 ast::AstNode, 721 ast::AstNode,
722 }; 722 };
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs
index be39b0e45..0796ceee1 100644
--- a/crates/ra_mbe/src/tests.rs
+++ b/crates/ra_mbe/src/tests.rs
@@ -1,13 +1,13 @@
1use std::fmt::Write; 1use std::fmt::Write;
2 2
3use ::parser::FragmentKind; 3use ::parser::FragmentKind;
4use ra_syntax::{ast, AstNode, NodeOrToken, SyntaxKind::IDENT, SyntaxNode, WalkEvent, T}; 4use syntax::{ast, AstNode, NodeOrToken, SyntaxKind::IDENT, SyntaxNode, WalkEvent, T};
5use test_utils::assert_eq_text; 5use test_utils::assert_eq_text;
6 6
7use super::*; 7use super::*;
8 8
9mod rule_parsing { 9mod rule_parsing {
10 use ra_syntax::{ast, AstNode}; 10 use syntax::{ast, AstNode};
11 11
12 use crate::ast_to_token_tree; 12 use crate::ast_to_token_tree;
13 13
@@ -1698,7 +1698,7 @@ pub(crate) fn parse_to_token_tree_by_syntax(ra_fixture: &str) -> tt::Subtree {
1698 parsed 1698 parsed
1699} 1699}
1700 1700
1701fn debug_dump_ignore_spaces(node: &ra_syntax::SyntaxNode) -> String { 1701fn debug_dump_ignore_spaces(node: &syntax::SyntaxNode) -> String {
1702 let mut level = 0; 1702 let mut level = 0;
1703 let mut buf = String::new(); 1703 let mut buf = String::new();
1704 macro_rules! indent { 1704 macro_rules! indent {
@@ -1718,7 +1718,7 @@ fn debug_dump_ignore_spaces(node: &ra_syntax::SyntaxNode) -> String {
1718 writeln!(buf, "{:?}", node.kind()).unwrap(); 1718 writeln!(buf, "{:?}", node.kind()).unwrap();
1719 } 1719 }
1720 NodeOrToken::Token(token) => match token.kind() { 1720 NodeOrToken::Token(token) => match token.kind() {
1721 ra_syntax::SyntaxKind::WHITESPACE => {} 1721 syntax::SyntaxKind::WHITESPACE => {}
1722 _ => { 1722 _ => {
1723 indent!(); 1723 indent!();
1724 writeln!(buf, "{:?}", token.kind()).unwrap(); 1724 writeln!(buf, "{:?}", token.kind()).unwrap();