#[derive(Debug)] pub struct WithLocation { value: T, location: (usize, usize), } impl WithLocation { pub fn new(value: T, start: usize, end: usize) -> WithLocation { WithLocation { value: value, location: (start, end), } } pub fn map U>(self, f: F) -> WithLocation { WithLocation { value: f(self.value), location: self.location, } } } #[derive(Debug)] pub struct Program(pub Box>); #[derive(Debug)] pub enum Expression { Number(u64), }