microcad_lang/src_ref/line_col.rs
1// Copyright © 2024-2025 The µcad authors <info@ucad.xyz>
2// SPDX-License-Identifier: AGPL-3.0-or-later
3
4/// Line and column within a source code file
5#[derive(Clone, Debug, Default)]
6pub struct LineCol {
7 /// Line number (1..)
8 pub line: usize,
9 /// Column number (1..)
10 pub col: usize,
11}
12
13impl std::fmt::Display for LineCol {
14 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15 write!(f, "{}:{}", self.line, self.col)
16 }
17}