#[derive(Debug, Clone)] pub struct SourceMap { pub node: T, pub data: Option } impl SourceMap { pub fn get(&self) -> &T { &self.node } pub fn get_source_data(&self) -> Option { self.data.clone() } } #[derive(Debug, Clone)] pub struct SourceData { pub line_number: usize, pub char_idx: usize }