Move Suite to ranged and located

This commit is contained in:
Micha Reiser 2023-05-14 17:06:30 +02:00
parent 028c04466d
commit c2e9921785
No known key found for this signature in database
3 changed files with 6 additions and 4 deletions

View file

@ -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;

View file

@ -13,5 +13,7 @@ pub trait Located {
}
}
pub type Suite = Vec<Stmt>;
pub use crate::builtin::*;
include!("gen/located.rs");

View file

@ -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;