mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 15:14:19 -05:00
integrate ast::Location into compilre-core::Location
This commit is contained in:
@@ -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.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user