Make parser location optional

This commit is contained in:
Jeong YunWon 2023-05-11 04:17:56 +09:00
parent aabc96dde9
commit cbe4e8c5f3
9 changed files with 18 additions and 14 deletions

View file

@ -8,9 +8,9 @@ repository = "https://github.com/RustPython/RustPython"
license = "MIT"
[features]
default = ["constant-optimization", "fold", "source-code"]
default = ["location"]
constant-optimization = ["fold"]
source-code = ["fold"]
location = ["fold", "rustpython-parser-core/location"]
fold = []
unparse = ["rustpython-literal"]
visitor = []

View file

@ -8,7 +8,7 @@ mod generic {
include!("gen/generic.rs");
}
mod impls;
#[cfg(feature = "source-code")]
#[cfg(feature = "location")]
mod source_locator;
#[cfg(feature = "unparse")]
mod unparse;
@ -32,11 +32,12 @@ mod visitor {
include!("gen/visitor.rs");
}
#[cfg(feature = "source-code")]
#[cfg(feature = "location")]
pub mod located {
include!("gen/located.rs");
}
#[cfg(feature = "location")]
pub use rustpython_parser_core::source_code;
#[cfg(feature = "visitor")]
pub use visitor::Visitor;