mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 07:04:22 +00:00
Split out rustc_lexer from rustc_dependencies
This commit is contained in:
parent
af40101841
commit
b97ab00bd4
11 changed files with 22 additions and 28 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
@ -1196,7 +1196,7 @@ dependencies = [
|
|||
"drop_bomb",
|
||||
"expect-test",
|
||||
"limit",
|
||||
"rustc-dependencies",
|
||||
"ra-ap-rustc_lexer",
|
||||
"sourcegen",
|
||||
"stdx",
|
||||
]
|
||||
|
@ -1605,7 +1605,6 @@ version = "0.0.0"
|
|||
dependencies = [
|
||||
"ra-ap-rustc_abi",
|
||||
"ra-ap-rustc_index",
|
||||
"ra-ap-rustc_lexer",
|
||||
"ra-ap-rustc_parse_format",
|
||||
]
|
||||
|
||||
|
@ -1808,9 +1807,9 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"profile",
|
||||
"quote",
|
||||
"ra-ap-rustc_lexer",
|
||||
"rayon",
|
||||
"rowan",
|
||||
"rustc-dependencies",
|
||||
"rustc-hash",
|
||||
"smol_str",
|
||||
"sourcegen",
|
||||
|
|
|
@ -80,6 +80,8 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
|
|||
vfs = { path = "./crates/vfs", version = "0.0.0" }
|
||||
rustc-dependencies = { path = "./crates/rustc-dependencies", version = "0.0.0" }
|
||||
|
||||
ra-ap-rustc_lexer = "0.21.0"
|
||||
|
||||
# local crates that aren't published to crates.io. These should not have versions.
|
||||
sourcegen = { path = "./crates/sourcegen" }
|
||||
test-fixture = { path = "./crates/test-fixture" }
|
||||
|
|
|
@ -13,8 +13,7 @@ doctest = false
|
|||
|
||||
[dependencies]
|
||||
drop_bomb = "0.1.5"
|
||||
rustc-dependencies.workspace = true
|
||||
|
||||
ra-ap-rustc_lexer.workspace = true
|
||||
limit.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -24,7 +23,7 @@ stdx.workspace = true
|
|||
sourcegen.workspace = true
|
||||
|
||||
[features]
|
||||
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
|
||||
in-rust-tree = []
|
||||
|
||||
[lints]
|
||||
workspace = true
|
|
@ -8,8 +8,6 @@
|
|||
//! Note that these tokens, unlike the tokens we feed into the parser, do
|
||||
//! include info about comments and whitespace.
|
||||
|
||||
use rustc_dependencies::lexer as rustc_lexer;
|
||||
|
||||
use std::ops;
|
||||
|
||||
use rustc_lexer::unescape::{EscapeError, Mode};
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
#![allow(rustdoc::private_intra_doc_links)]
|
||||
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
|
||||
|
||||
#[cfg(not(feature = "in-rust-tree"))]
|
||||
extern crate ra_ap_rustc_lexer as rustc_lexer;
|
||||
#[cfg(feature = "in-rust-tree")]
|
||||
extern crate rustc_lexer;
|
||||
|
||||
mod lexed_str;
|
||||
mod token_set;
|
||||
mod syntax_kind;
|
||||
|
|
|
@ -11,7 +11,6 @@ authors.workspace = true
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
ra-ap-rustc_lexer = { version = "0.21.0" }
|
||||
ra-ap-rustc_parse_format = { version = "0.21.0", default-features = false }
|
||||
ra-ap-rustc_index = { version = "0.21.0", default-features = false }
|
||||
ra-ap-rustc_abi = { version = "0.21.0", default-features = false }
|
||||
|
|
|
@ -3,17 +3,6 @@
|
|||
|
||||
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
|
||||
|
||||
#[cfg(feature = "in-rust-tree")]
|
||||
extern crate rustc_lexer;
|
||||
|
||||
pub mod lexer {
|
||||
#[cfg(not(feature = "in-rust-tree"))]
|
||||
pub use ::ra_ap_rustc_lexer::*;
|
||||
|
||||
#[cfg(feature = "in-rust-tree")]
|
||||
pub use ::rustc_lexer::*;
|
||||
}
|
||||
|
||||
#[cfg(feature = "in-rust-tree")]
|
||||
extern crate rustc_parse_format;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ indexmap.workspace = true
|
|||
smol_str.workspace = true
|
||||
triomphe.workspace = true
|
||||
|
||||
rustc-dependencies.workspace = true
|
||||
ra-ap-rustc_lexer.workspace = true
|
||||
|
||||
parser.workspace = true
|
||||
profile.workspace = true
|
||||
|
@ -41,7 +41,7 @@ test-utils.workspace = true
|
|||
sourcegen.workspace = true
|
||||
|
||||
[features]
|
||||
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
|
||||
in-rust-tree = []
|
||||
|
||||
[lints]
|
||||
workspace = true
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use rustc_dependencies::lexer as rustc_lexer;
|
||||
|
||||
use rustc_lexer::unescape::{
|
||||
unescape_byte, unescape_c_string, unescape_char, unescape_literal, CStrUnit, Mode,
|
||||
};
|
||||
|
|
|
@ -22,6 +22,11 @@
|
|||
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
|
||||
#![warn(rust_2018_idioms, unused_lifetimes)]
|
||||
|
||||
#[cfg(not(feature = "in-rust-tree"))]
|
||||
extern crate ra_ap_rustc_lexer as rustc_lexer;
|
||||
#[cfg(feature = "in-rust-tree")]
|
||||
extern crate rustc_lexer;
|
||||
|
||||
#[allow(unused)]
|
||||
macro_rules! eprintln {
|
||||
($($tt:tt)*) => { stdx::eprintln!($($tt)*) };
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
mod block;
|
||||
|
||||
use rowan::Direction;
|
||||
use rustc_dependencies::lexer::unescape::{self, unescape_literal, Mode};
|
||||
use rustc_lexer::unescape::{self, unescape_literal, Mode};
|
||||
|
||||
use crate::{
|
||||
algo,
|
||||
|
|
Loading…
Reference in a new issue