vendor text_size and source_location (#102)

This commit is contained in:
Jeong, YunWon 2023-08-29 19:52:25 +09:00 committed by GitHub
parent b07966695a
commit d09bce80e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 175 additions and 311 deletions

View file

@ -8,14 +8,12 @@ repository = "https://github.com/RustPython/Parser/"
license = "MIT"
[dependencies]
# ruff dependency shouldn't be placed out of this crate
ruff_text_size = { path = "../ruff_text_size" }
ruff_source_location = { path = "../ruff_source_location", optional = true }
# vendored dependency shouldn't be placed out of this crate
rustpython-parser-vendored.workspace = true
serde = { version = "1.0.133", optional = true, default-features = false, features = ["derive"] }
is-macro.workspace = true
memchr.workspace = true
[features]
default = []
location = ["dep:ruff_source_location"]
location = []

View file

@ -11,5 +11,6 @@ pub use error::BaseError;
pub use format::ConversionFlag;
pub use mode::Mode;
// re-export our public interface
pub use ruff_text_size as text_size;
#[cfg(feature = "location")]
pub use rustpython_parser_vendored::source_location;
pub use rustpython_parser_vendored::text_size;

View file

@ -2,7 +2,7 @@
use crate::text_size::{TextLen, TextSize};
use memchr::memrchr2;
pub use ruff_source_location::{
pub use crate::source_location::{
newlines::{find_newline, UniversalNewlineIterator},
LineIndex, OneIndexed, SourceCode, SourceLocation,
};