rustpython_ast/
located.rs

1#![allow(clippy::derive_partial_eq_without_eq)]
2use crate::source_code::{SourceLocation, SourceRange};
3
4pub trait Located {
5    fn range(&self) -> SourceRange;
6
7    fn location(&self) -> SourceLocation {
8        self.range().start
9    }
10
11    fn end_location(&self) -> Option<SourceLocation> {
12        self.range().end
13    }
14}
15
16pub trait LocatedMut: Located {
17    fn range_mut(&mut self) -> &mut SourceRange;
18}
19
20pub type Suite = Vec<Stmt>;
21
22pub use crate::builtin::*;
23include!("gen/located.rs");