about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock20
-rw-r--r--crates/parser/Cargo.toml (renamed from crates/ra_parser/Cargo.toml)9
-rw-r--r--crates/parser/src/event.rs (renamed from crates/ra_parser/src/event.rs)0
-rw-r--r--crates/parser/src/grammar.rs (renamed from crates/ra_parser/src/grammar.rs)0
-rw-r--r--crates/parser/src/grammar/attributes.rs (renamed from crates/ra_parser/src/grammar/attributes.rs)0
-rw-r--r--crates/parser/src/grammar/expressions.rs (renamed from crates/ra_parser/src/grammar/expressions.rs)0
-rw-r--r--crates/parser/src/grammar/expressions/atom.rs (renamed from crates/ra_parser/src/grammar/expressions/atom.rs)0
-rw-r--r--crates/parser/src/grammar/items.rs (renamed from crates/ra_parser/src/grammar/items.rs)0
-rw-r--r--crates/parser/src/grammar/items/adt.rs (renamed from crates/ra_parser/src/grammar/items/adt.rs)0
-rw-r--r--crates/parser/src/grammar/items/consts.rs (renamed from crates/ra_parser/src/grammar/items/consts.rs)0
-rw-r--r--crates/parser/src/grammar/items/traits.rs (renamed from crates/ra_parser/src/grammar/items/traits.rs)0
-rw-r--r--crates/parser/src/grammar/items/use_item.rs (renamed from crates/ra_parser/src/grammar/items/use_item.rs)0
-rw-r--r--crates/parser/src/grammar/params.rs (renamed from crates/ra_parser/src/grammar/params.rs)0
-rw-r--r--crates/parser/src/grammar/paths.rs (renamed from crates/ra_parser/src/grammar/paths.rs)0
-rw-r--r--crates/parser/src/grammar/patterns.rs (renamed from crates/ra_parser/src/grammar/patterns.rs)0
-rw-r--r--crates/parser/src/grammar/type_args.rs (renamed from crates/ra_parser/src/grammar/type_args.rs)0
-rw-r--r--crates/parser/src/grammar/type_params.rs (renamed from crates/ra_parser/src/grammar/type_params.rs)0
-rw-r--r--crates/parser/src/grammar/types.rs (renamed from crates/ra_parser/src/grammar/types.rs)0
-rw-r--r--crates/parser/src/lib.rs (renamed from crates/ra_parser/src/lib.rs)0
-rw-r--r--crates/parser/src/parser.rs (renamed from crates/ra_parser/src/parser.rs)0
-rw-r--r--crates/parser/src/syntax_kind.rs (renamed from crates/ra_parser/src/syntax_kind.rs)0
-rw-r--r--crates/parser/src/syntax_kind/generated.rs (renamed from crates/ra_parser/src/syntax_kind/generated.rs)0
-rw-r--r--crates/parser/src/token_set.rs (renamed from crates/ra_parser/src/token_set.rs)0
-rw-r--r--crates/ra_hir_expand/Cargo.toml2
-rw-r--r--crates/ra_hir_expand/src/builtin_derive.rs2
-rw-r--r--crates/ra_hir_expand/src/builtin_macro.rs2
-rw-r--r--crates/ra_hir_expand/src/db.rs2
-rw-r--r--crates/ra_hir_expand/src/eager.rs2
-rw-r--r--crates/ra_hir_expand/src/lib.rs2
-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
-rw-r--r--crates/ra_syntax/Cargo.toml2
-rw-r--r--crates/ra_syntax/src/ast/node_ext.rs2
-rw-r--r--crates/ra_syntax/src/lib.rs14
-rw-r--r--crates/ra_syntax/src/parsing.rs14
-rw-r--r--crates/ra_syntax/src/parsing/reparsing.rs2
-rw-r--r--crates/ra_syntax/src/parsing/text_token_source.rs14
-rw-r--r--crates/ra_syntax/src/parsing/text_tree_sink.rs2
-rw-r--r--crates/ra_syntax/src/syntax_node.rs2
-rw-r--r--docs/dev/README.md4
-rw-r--r--docs/dev/architecture.md2
-rw-r--r--docs/dev/syntax.md2
-rw-r--r--xtask/src/codegen.rs4
-rw-r--r--xtask/tests/tidy.rs2
47 files changed, 65 insertions, 65 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 4a6a6593415..095127b99f2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -835,6 +835,13 @@ dependencies = [
 ]
 
 [[package]]
+name = "parser"
+version = "0.0.0"
+dependencies = [
+ "drop_bomb",
+]
+
+[[package]]
 name = "paths"
 version = "0.1.0"
 
@@ -1018,10 +1025,10 @@ dependencies = [
  "arena",
  "either",
  "log",
+ "parser",
  "profile",
  "ra_db",
  "ra_mbe",
- "ra_parser",
  "ra_syntax",
  "rustc-hash",
  "test_utils",
@@ -1105,7 +1112,7 @@ name = "ra_mbe"
 version = "0.1.0"
 dependencies = [
  "log",
- "ra_parser",
+ "parser",
  "ra_syntax",
  "rustc-hash",
  "smallvec",
@@ -1114,13 +1121,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "ra_parser"
-version = "0.1.0"
-dependencies = [
- "drop_bomb",
-]
-
-[[package]]
 name = "ra_proc_macro"
 version = "0.1.0"
 dependencies = [
@@ -1190,7 +1190,7 @@ dependencies = [
  "expect",
  "itertools",
  "once_cell",
- "ra_parser",
+ "parser",
  "rayon",
  "rowan",
  "rustc-ap-rustc_lexer",
diff --git a/crates/ra_parser/Cargo.toml b/crates/parser/Cargo.toml
index 72ec3e4d9a3..358be92d122 100644
--- a/crates/ra_parser/Cargo.toml
+++ b/crates/parser/Cargo.toml
@@ -1,10 +1,9 @@
 [package]
-edition = "2018"
-name = "ra_parser"
-version = "0.1.0"
-authors = ["rust-analyzer developers"]
-publish = false
+name = "parser"
+version = "0.0.0"
 license = "MIT OR Apache-2.0"
+authors = ["rust-analyzer developers"]
+edition = "2018"
 
 [lib]
 doctest = false
diff --git a/crates/ra_parser/src/event.rs b/crates/parser/src/event.rs
index a7d06a815cb..a7d06a815cb 100644
--- a/crates/ra_parser/src/event.rs
+++ b/crates/parser/src/event.rs
diff --git a/crates/ra_parser/src/grammar.rs b/crates/parser/src/grammar.rs
index 88468bc9716..88468bc9716 100644
--- a/crates/ra_parser/src/grammar.rs
+++ b/crates/parser/src/grammar.rs
diff --git a/crates/ra_parser/src/grammar/attributes.rs b/crates/parser/src/grammar/attributes.rs
index f3158ade300..f3158ade300 100644
--- a/crates/ra_parser/src/grammar/attributes.rs
+++ b/crates/parser/src/grammar/attributes.rs
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs
index 3291e3f1469..3291e3f1469 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/parser/src/grammar/expressions.rs
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs
index 0b01d3bc646..0b01d3bc646 100644
--- a/crates/ra_parser/src/grammar/expressions/atom.rs
+++ b/crates/parser/src/grammar/expressions/atom.rs
diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs
index d091b0fbb29..d091b0fbb29 100644
--- a/crates/ra_parser/src/grammar/items.rs
+++ b/crates/parser/src/grammar/items.rs
diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/parser/src/grammar/items/adt.rs
index addfb59d4b1..addfb59d4b1 100644
--- a/crates/ra_parser/src/grammar/items/adt.rs
+++ b/crates/parser/src/grammar/items/adt.rs
diff --git a/crates/ra_parser/src/grammar/items/consts.rs b/crates/parser/src/grammar/items/consts.rs
index 35ad766dcee..35ad766dcee 100644
--- a/crates/ra_parser/src/grammar/items/consts.rs
+++ b/crates/parser/src/grammar/items/consts.rs
diff --git a/crates/ra_parser/src/grammar/items/traits.rs b/crates/parser/src/grammar/items/traits.rs
index 751ce65f2dc..751ce65f2dc 100644
--- a/crates/ra_parser/src/grammar/items/traits.rs
+++ b/crates/parser/src/grammar/items/traits.rs
diff --git a/crates/ra_parser/src/grammar/items/use_item.rs b/crates/parser/src/grammar/items/use_item.rs
index 8e836a77e1d..8e836a77e1d 100644
--- a/crates/ra_parser/src/grammar/items/use_item.rs
+++ b/crates/parser/src/grammar/items/use_item.rs
diff --git a/crates/ra_parser/src/grammar/params.rs b/crates/parser/src/grammar/params.rs
index f0da173cc17..f0da173cc17 100644
--- a/crates/ra_parser/src/grammar/params.rs
+++ b/crates/parser/src/grammar/params.rs
diff --git a/crates/ra_parser/src/grammar/paths.rs b/crates/parser/src/grammar/paths.rs
index b503af1dc94..b503af1dc94 100644
--- a/crates/ra_parser/src/grammar/paths.rs
+++ b/crates/parser/src/grammar/paths.rs
diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/parser/src/grammar/patterns.rs
index 716bdc97840..716bdc97840 100644
--- a/crates/ra_parser/src/grammar/patterns.rs
+++ b/crates/parser/src/grammar/patterns.rs
diff --git a/crates/ra_parser/src/grammar/type_args.rs b/crates/parser/src/grammar/type_args.rs
index aef7cd6fbb2..aef7cd6fbb2 100644
--- a/crates/ra_parser/src/grammar/type_args.rs
+++ b/crates/parser/src/grammar/type_args.rs
diff --git a/crates/ra_parser/src/grammar/type_params.rs b/crates/parser/src/grammar/type_params.rs
index 90dabb4c0f1..90dabb4c0f1 100644
--- a/crates/ra_parser/src/grammar/type_params.rs
+++ b/crates/parser/src/grammar/type_params.rs
diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/parser/src/grammar/types.rs
index 0aa173a52b2..0aa173a52b2 100644
--- a/crates/ra_parser/src/grammar/types.rs
+++ b/crates/parser/src/grammar/types.rs
diff --git a/crates/ra_parser/src/lib.rs b/crates/parser/src/lib.rs
index eeb8ad66bd1..eeb8ad66bd1 100644
--- a/crates/ra_parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
diff --git a/crates/ra_parser/src/parser.rs b/crates/parser/src/parser.rs
index d2487acc3b9..d2487acc3b9 100644
--- a/crates/ra_parser/src/parser.rs
+++ b/crates/parser/src/parser.rs
diff --git a/crates/ra_parser/src/syntax_kind.rs b/crates/parser/src/syntax_kind.rs
index 63204436c33..63204436c33 100644
--- a/crates/ra_parser/src/syntax_kind.rs
+++ b/crates/parser/src/syntax_kind.rs
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/parser/src/syntax_kind/generated.rs
index 192ecd864e9..192ecd864e9 100644
--- a/crates/ra_parser/src/syntax_kind/generated.rs
+++ b/crates/parser/src/syntax_kind/generated.rs
diff --git a/crates/ra_parser/src/token_set.rs b/crates/parser/src/token_set.rs
index 994017acfd4..994017acfd4 100644
--- a/crates/ra_parser/src/token_set.rs
+++ b/crates/parser/src/token_set.rs
diff --git a/crates/ra_hir_expand/Cargo.toml b/crates/ra_hir_expand/Cargo.toml
index 7d8ccd56fc5..052330fdefa 100644
--- a/crates/ra_hir_expand/Cargo.toml
+++ b/crates/ra_hir_expand/Cargo.toml
@@ -16,7 +16,7 @@ rustc-hash = "1.0.0"
 arena = { path = "../arena" }
 ra_db = { path = "../ra_db" }
 ra_syntax = { path = "../ra_syntax" }
-ra_parser = { path = "../ra_parser" }
+parser = { path = "../parser" }
 profile = { path = "../profile" }
 tt = { path = "../tt" }
 mbe = { path = "../ra_mbe", package = "ra_mbe" }
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs
index 69fa907cb89..95e6977f24a 100644
--- a/crates/ra_hir_expand/src/builtin_derive.rs
+++ b/crates/ra_hir_expand/src/builtin_derive.rs
@@ -2,7 +2,7 @@
 
 use log::debug;
 
-use ra_parser::FragmentKind;
+use parser::FragmentKind;
 use ra_syntax::{
     ast::{self, AstNode, GenericParamsOwner, ModuleItemOwner, NameOwner},
     match_ast,
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs
index 9f50569dc41..24dc0b4e7fd 100644
--- a/crates/ra_hir_expand/src/builtin_macro.rs
+++ b/crates/ra_hir_expand/src/builtin_macro.rs
@@ -6,8 +6,8 @@ use crate::{
 
 use either::Either;
 use mbe::parse_to_token_tree;
+use parser::FragmentKind;
 use ra_db::FileId;
-use ra_parser::FragmentKind;
 use ra_syntax::ast::{self, AstToken, HasStringValue};
 
 macro_rules! register_builtin {
diff --git a/crates/ra_hir_expand/src/db.rs b/crates/ra_hir_expand/src/db.rs
index f30528b3e27..d83c391a90b 100644
--- a/crates/ra_hir_expand/src/db.rs
+++ b/crates/ra_hir_expand/src/db.rs
@@ -3,8 +3,8 @@
 use std::sync::Arc;
 
 use mbe::{ExpandResult, MacroRules};
+use parser::FragmentKind;
 use ra_db::{salsa, SourceDatabase};
-use ra_parser::FragmentKind;
 use ra_syntax::{algo::diff, AstNode, GreenNode, Parse, SyntaxKind::*, SyntaxNode};
 
 use crate::{
diff --git a/crates/ra_hir_expand/src/eager.rs b/crates/ra_hir_expand/src/eager.rs
index 302d2b3e099..dc83044ea4e 100644
--- a/crates/ra_hir_expand/src/eager.rs
+++ b/crates/ra_hir_expand/src/eager.rs
@@ -25,8 +25,8 @@ use crate::{
     EagerCallLoc, EagerMacroId, InFile, MacroCallId, MacroCallKind, MacroDefId, MacroDefKind,
 };
 
+use parser::FragmentKind;
 use ra_db::CrateId;
-use ra_parser::FragmentKind;
 use ra_syntax::{algo::SyntaxRewriter, SyntaxNode};
 use std::sync::Arc;
 
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs
index 8bb735fc625..38f0ffff81c 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -317,7 +317,7 @@ pub struct ExpansionInfo {
 }
 
 pub use mbe::Origin;
-use ra_parser::FragmentKind;
+use parser::FragmentKind;
 
 impl ExpansionInfo {
     pub fn call_node(&self) -> Option<InFile<SyntaxNode>> {
diff --git a/crates/ra_mbe/Cargo.toml b/crates/ra_mbe/Cargo.toml
index 23315910c47..e518f73e32c 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 933a3a3b5e3..c752804b29d 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<Option<tt::TokenTree>> {
         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 d7866452dd9..1a1cb08cf77 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 5fc48507ff5..7b9c88ae643 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 286983d60bc..be39b0e45ee 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) {
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml
index f2789e6a351..eec4bd845ed 100644
--- a/crates/ra_syntax/Cargo.toml
+++ b/crates/ra_syntax/Cargo.toml
@@ -21,7 +21,7 @@ once_cell = "1.3.1"
 stdx = { path = "../stdx" }
 
 text_edit = { path = "../text_edit" }
-ra_parser = { path = "../ra_parser" }
+parser = { path = "../parser" }
 
 # This crate transitively depends on `smol_str` via `rowan`.
 # ideally, `serde` should be enabled by `rust-analyzer`, but we enable it here
diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs
index 733e978772c..50c1c157d87 100644
--- a/crates/ra_syntax/src/ast/node_ext.rs
+++ b/crates/ra_syntax/src/ast/node_ext.rs
@@ -4,7 +4,7 @@
 use std::fmt;
 
 use itertools::Itertools;
-use ra_parser::SyntaxKind;
+use parser::SyntaxKind;
 
 use crate::{
     ast::{self, support, AstNode, NameOwner, SyntaxNode},
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index 465607f550f..7f8da66af07 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -11,7 +11,7 @@
 //!
 //! The most interesting modules here are `syntax_node` (which defines concrete
 //! syntax tree) and `ast` (which defines abstract syntax tree on top of the
-//! CST). The actual parser live in a separate `ra_parser` crate, though the
+//! CST). The actual parser live in a separate `parser` crate, though the
 //! lexer lives in this crate.
 //!
 //! See `api_walkthrough` test in this file for a quick API tour!
@@ -53,7 +53,7 @@ pub use crate::{
         SyntaxNodeChildren, SyntaxToken, SyntaxTreeBuilder,
     },
 };
-pub use ra_parser::{SyntaxKind, T};
+pub use parser::{SyntaxKind, T};
 pub use rowan::{SmolStr, SyntaxText, TextRange, TextSize, TokenAtOffset, WalkEvent};
 
 /// `Parse` is the result of the parsing: a syntax tree and a collection of
@@ -169,35 +169,35 @@ impl SourceFile {
 impl ast::Path {
     /// Returns `text`, parsed as a path, but only if it has no errors.
     pub fn parse(text: &str) -> Result<Self, ()> {
-        parsing::parse_text_fragment(text, ra_parser::FragmentKind::Path)
+        parsing::parse_text_fragment(text, parser::FragmentKind::Path)
     }
 }
 
 impl ast::Pat {
     /// Returns `text`, parsed as a pattern, but only if it has no errors.
     pub fn parse(text: &str) -> Result<Self, ()> {
-        parsing::parse_text_fragment(text, ra_parser::FragmentKind::Pattern)
+        parsing::parse_text_fragment(text, parser::FragmentKind::Pattern)
     }
 }
 
 impl ast::Expr {
     /// Returns `text`, parsed as an expression, but only if it has no errors.
     pub fn parse(text: &str) -> Result<Self, ()> {
-        parsing::parse_text_fragment(text, ra_parser::FragmentKind::Expr)
+        parsing::parse_text_fragment(text, parser::FragmentKind::Expr)
     }
 }
 
 impl ast::Item {
     /// Returns `text`, parsed as an item, but only if it has no errors.
     pub fn parse(text: &str) -> Result<Self, ()> {
-        parsing::parse_text_fragment(text, ra_parser::FragmentKind::Item)
+        parsing::parse_text_fragment(text, parser::FragmentKind::Item)
     }
 }
 
 impl ast::Type {
     /// Returns `text`, parsed as an type reference, but only if it has no errors.
     pub fn parse(text: &str) -> Result<Self, ()> {
-        parsing::parse_text_fragment(text, ra_parser::FragmentKind::Type)
+        parsing::parse_text_fragment(text, parser::FragmentKind::Type)
     }
 }
 
diff --git a/crates/ra_syntax/src/parsing.rs b/crates/ra_syntax/src/parsing.rs
index 0ed3c20ef92..68a39eb2103 100644
--- a/crates/ra_syntax/src/parsing.rs
+++ b/crates/ra_syntax/src/parsing.rs
@@ -1,4 +1,4 @@
-//! Lexing, bridging to ra_parser (which does the actual parsing) and
+//! Lexing, bridging to parser (which does the actual parsing) and
 //! incremental reparsing.
 
 mod lexer;
@@ -13,7 +13,7 @@ use text_tree_sink::TextTreeSink;
 pub use lexer::*;
 
 pub(crate) use self::reparsing::incremental_reparse;
-use ra_parser::SyntaxKind;
+use parser::SyntaxKind;
 
 pub(crate) fn parse_text(text: &str) -> (GreenNode, Vec<SyntaxError>) {
     let (tokens, lexer_errors) = tokenize(&text);
@@ -21,7 +21,7 @@ pub(crate) fn parse_text(text: &str) -> (GreenNode, Vec<SyntaxError>) {
     let mut token_source = TextTokenSource::new(text, &tokens);
     let mut tree_sink = TextTreeSink::new(text, &tokens);
 
-    ra_parser::parse(&mut token_source, &mut tree_sink);
+    parser::parse(&mut token_source, &mut tree_sink);
 
     let (tree, mut parser_errors) = tree_sink.finish();
     parser_errors.extend(lexer_errors);
@@ -32,7 +32,7 @@ pub(crate) fn parse_text(text: &str) -> (GreenNode, Vec<SyntaxError>) {
 /// Returns `text` parsed as a `T` provided there are no parse errors.
 pub(crate) fn parse_text_fragment<T: AstNode>(
     text: &str,
-    fragment_kind: ra_parser::FragmentKind,
+    fragment_kind: parser::FragmentKind,
 ) -> Result<T, ()> {
     let (tokens, lexer_errors) = tokenize(&text);
     if !lexer_errors.is_empty() {
@@ -44,13 +44,13 @@ pub(crate) fn parse_text_fragment<T: AstNode>(
 
     // TextTreeSink assumes that there's at least some root node to which it can attach errors and
     // tokens. We arbitrarily give it a SourceFile.
-    use ra_parser::TreeSink;
+    use parser::TreeSink;
     tree_sink.start_node(SyntaxKind::SOURCE_FILE);
-    ra_parser::parse_fragment(&mut token_source, &mut tree_sink, fragment_kind);
+    parser::parse_fragment(&mut token_source, &mut tree_sink, fragment_kind);
     tree_sink.finish_node();
 
     let (tree, parser_errors) = tree_sink.finish();
-    use ra_parser::TokenSource;
+    use parser::TokenSource;
     if !parser_errors.is_empty() || token_source.current().kind != SyntaxKind::EOF {
         return Err(());
     }
diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs
index 6644ffca4fa..4149f856a83 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 97aa3e7951c..df866dc2b75 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 6d1828d2039..c1b5f246d11 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,
diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs
index a7dbdba7b11..b2abcbfbb36 100644
--- a/crates/ra_syntax/src/syntax_node.rs
+++ b/crates/ra_syntax/src/syntax_node.rs
@@ -71,7 +71,7 @@ impl SyntaxTreeBuilder {
         self.inner.finish_node()
     }
 
-    pub fn error(&mut self, error: ra_parser::ParseError, text_pos: TextSize) {
+    pub fn error(&mut self, error: parser::ParseError, text_pos: TextSize) {
         self.errors.push(SyntaxError::new_at_offset(*error.0, text_pos))
     }
 }
diff --git a/docs/dev/README.md b/docs/dev/README.md
index 51cf716b3df..33829c59371 100644
--- a/docs/dev/README.md
+++ b/docs/dev/README.md
@@ -92,11 +92,11 @@ This is primarily useful for performance optimizations, or for bug minimization.
 
 ## Parser Tests
 
-Tests for the parser (`ra_parser`) live in the `ra_syntax` crate (see `test_data` directory).
+Tests for the parser (`parser`) live in the `ra_syntax` crate (see `test_data` directory).
 There are two kinds of tests:
 
 * Manually written test cases in `parser/ok` and `parser/err`
-* "Inline" tests in `parser/inline` (these are generated) from comments in `ra_parser` crate.
+* "Inline" tests in `parser/inline` (these are generated) from comments in `parser` crate.
 
 The purpose of inline tests is not to achieve full coverage by test cases, but to explain to the reader of the code what each particular `if` and `match` is responsible for.
 If you are tempted to add a large inline test, it might be a good idea to leave only the simplest example in place, and move the test to a manual `parser/ok` test.
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md
index d0c6eea61f8..21373729c71 100644
--- a/docs/dev/architecture.md
+++ b/docs/dev/architecture.md
@@ -64,7 +64,7 @@ The source for 1 and 2 is in [`ast_src.rs`](https://github.com/rust-analyzer/rus
 
 ## Code Walk-Through
 
-### `crates/ra_syntax`, `crates/ra_parser`
+### `crates/ra_syntax`, `crates/parser`
 
 Rust syntax tree structure and parser. See
 [RFC](https://github.com/rust-lang/rfcs/pull/2256) and [./syntax.md](./syntax.md) for some design notes.
diff --git a/docs/dev/syntax.md b/docs/dev/syntax.md
index f1bcdc4aff8..c08062ef4dc 100644
--- a/docs/dev/syntax.md
+++ b/docs/dev/syntax.md
@@ -11,7 +11,7 @@ The things described are implemented in two places
 * [rowan](https://github.com/rust-analyzer/rowan/tree/v0.9.0) -- a generic library for rowan syntax trees.
 * [ra_syntax](https://github.com/rust-analyzer/rust-analyzer/tree/cf5bdf464cad7ceb9a67e07985a3f4d3799ec0b6/crates/ra_syntax) crate inside rust-analyzer which wraps `rowan` into rust-analyzer specific API.
   Nothing in rust-analyzer except this crate knows about `rowan`.
-* [ra_parser](https://github.com/rust-analyzer/rust-analyzer/tree/cf5bdf464cad7ceb9a67e07985a3f4d3799ec0b6/crates/ra_parser) crate parses input tokens into an `ra_syntax` tree
+* [parser](https://github.com/rust-analyzer/rust-analyzer/tree/cf5bdf464cad7ceb9a67e07985a3f4d3799ec0b6/crates/parser) crate parses input tokens into an `ra_syntax` tree
 
 ## Design Goals
 
diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs
index f5f4b964a4c..08e7a10b755 100644
--- a/xtask/src/codegen.rs
+++ b/xtask/src/codegen.rs
@@ -24,11 +24,11 @@ pub use self::{
     gen_syntax::generate_syntax,
 };
 
-const GRAMMAR_DIR: &str = "crates/ra_parser/src/grammar";
+const GRAMMAR_DIR: &str = "crates/parser/src/grammar";
 const OK_INLINE_TESTS_DIR: &str = "crates/ra_syntax/test_data/parser/inline/ok";
 const ERR_INLINE_TESTS_DIR: &str = "crates/ra_syntax/test_data/parser/inline/err";
 
-const SYNTAX_KINDS: &str = "crates/ra_parser/src/syntax_kind/generated.rs";
+const SYNTAX_KINDS: &str = "crates/parser/src/syntax_kind/generated.rs";
 const AST_NODES: &str = "crates/ra_syntax/src/ast/generated/nodes.rs";
 const AST_TOKENS: &str = "crates/ra_syntax/src/ast/generated/tokens.rs";
 
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs
index ddaab93ab70..f1a7e8288e7 100644
--- a/xtask/tests/tidy.rs
+++ b/xtask/tests/tidy.rs
@@ -196,7 +196,7 @@ impl TidyDocs {
             "ra_hir_expand",
             "ra_ide",
             "ra_mbe",
-            "ra_parser",
+            "parser",
             "profile",
             "ra_project_model",
             "ra_syntax",