mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-08 05:35:22 +00:00
Move Suite
to ranged
and located
This commit is contained in:
parent
028c04466d
commit
c2e9921785
3 changed files with 6 additions and 4 deletions
|
@ -16,11 +16,9 @@ mod unparse;
|
|||
|
||||
pub use builtin::*;
|
||||
pub use generic::*;
|
||||
pub use ranged::{EmptyRange, OptionalRange, Ranged};
|
||||
pub use ranged::{EmptyRange, OptionalRange, Ranged, Suite};
|
||||
pub use rustpython_parser_core::{text_size, ConversionFlag};
|
||||
|
||||
pub type Suite<R = TextRange> = Vec<Stmt<R>>;
|
||||
|
||||
#[cfg(feature = "fold")]
|
||||
pub mod fold {
|
||||
use super::generic::*;
|
||||
|
@ -48,4 +46,3 @@ mod optimizer;
|
|||
|
||||
#[cfg(feature = "constant-optimization")]
|
||||
pub use optimizer::ConstantOptimizer;
|
||||
use rustpython_parser_core::text_size::TextRange;
|
||||
|
|
|
@ -13,5 +13,7 @@ pub trait Located {
|
|||
}
|
||||
}
|
||||
|
||||
pub type Suite = Vec<Stmt>;
|
||||
|
||||
pub use crate::builtin::*;
|
||||
include!("gen/located.rs");
|
||||
|
|
|
@ -3,6 +3,7 @@ use std::fmt::{Debug, Display, Formatter};
|
|||
use std::marker::PhantomData;
|
||||
|
||||
pub use crate::builtin::*;
|
||||
use crate::Stmt;
|
||||
|
||||
pub trait Ranged {
|
||||
fn range(&self) -> TextRange;
|
||||
|
@ -16,6 +17,8 @@ pub trait Ranged {
|
|||
}
|
||||
}
|
||||
|
||||
pub type Suite<R = TextRange> = Vec<Stmt<R>>;
|
||||
|
||||
#[cfg(feature = "all-nodes-with-ranges")]
|
||||
pub type OptionalRange<R> = R;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue