mysz-core 0.3.0

The main compiler for the Mysz language project
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::rc::Rc;

#[derive(Clone, Debug)]
pub struct Location {
    pub line: usize,
    pub col: usize,
    pub file: Rc<str>,
}
impl Location {
    pub fn new_with_file(line: usize, col: usize, file: Rc<str>) -> Self {
        Self { line, col, file }
    }
}
impl std::fmt::Display for Location {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "li = {}, co = {}", self.line, self.col)
    }
}