mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:56 +00:00
Move StarImport
to its own module (#5186)
This commit is contained in:
parent
b369288833
commit
310abc769d
4 changed files with 11 additions and 9 deletions
|
@ -272,14 +272,6 @@ impl<'a> FromIterator<Binding<'a>> for Bindings<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct StarImport<'a> {
|
||||
/// The level of the import. `None` or `Some(0)` indicate an absolute import.
|
||||
pub level: Option<u32>,
|
||||
/// The module being imported. `None` indicates a wildcard import.
|
||||
pub module: Option<&'a str>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Export<'a> {
|
||||
/// The names of the bindings exported via `__all__`.
|
||||
|
|
|
@ -7,6 +7,7 @@ mod model;
|
|||
mod node;
|
||||
mod reference;
|
||||
mod scope;
|
||||
mod star_import;
|
||||
|
||||
pub use binding::*;
|
||||
pub use context::*;
|
||||
|
@ -16,3 +17,4 @@ pub use model::*;
|
|||
pub use node::*;
|
||||
pub use reference::*;
|
||||
pub use scope::*;
|
||||
pub use star_import::*;
|
||||
|
|
|
@ -8,8 +8,9 @@ use rustpython_parser::ast;
|
|||
|
||||
use ruff_index::{newtype_index, Idx, IndexSlice, IndexVec};
|
||||
|
||||
use crate::binding::{BindingId, StarImport};
|
||||
use crate::binding::BindingId;
|
||||
use crate::globals::GlobalsId;
|
||||
use crate::star_import::StarImport;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Scope<'a> {
|
||||
|
|
7
crates/ruff_python_semantic/src/star_import.rs
Normal file
7
crates/ruff_python_semantic/src/star_import.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
#[derive(Debug, Clone)]
|
||||
pub struct StarImport<'a> {
|
||||
/// The level of the import. `None` or `Some(0)` indicate an absolute import.
|
||||
pub level: Option<u32>,
|
||||
/// The module being imported. `None` indicates a wildcard import.
|
||||
pub module: Option<&'a str>,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue