mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-07 21:25:31 +00:00
integrate ast::Location into compilre-core::Location
This commit is contained in:
parent
bfac0355dc
commit
904fc477f1
8 changed files with 21 additions and 83 deletions
|
@ -7,6 +7,16 @@ pub struct Location {
|
|||
pub(super) column: u32,
|
||||
}
|
||||
|
||||
impl Location {
|
||||
pub fn fmt_with(
|
||||
&self,
|
||||
f: &mut std::fmt::Formatter,
|
||||
e: &impl std::fmt::Display,
|
||||
) -> std::fmt::Result {
|
||||
write!(f, "{} at line {} column {}", e, self.row(), self.column())
|
||||
}
|
||||
}
|
||||
|
||||
impl Location {
|
||||
/// Creates a new Location object at the given row and column.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue