assembler: we failing DSA with this one

This commit is contained in:
2025-06-25 14:31:53 +01:00
parent 9232f2ccab
commit 20a7d42adb
14 changed files with 508 additions and 38 deletions
+14 -6
View File
@@ -1,17 +1,25 @@
//! This file contains information on where a [`Token`] or [`Node`] is within the source
//! code for more informative errors. This will likely be attached to a [`Token`] which
//! will in turn be attached to an AST [`Node`].
//! code for more informative errors.
//!
//! This will likely be attached to a [`Token`] which will in turn be attached to an AST
//! [`Node`].
use uuid::Uuid;
use std::fmt::Display;
use crate::model::module::Module;
/// Information on where the token is within the source.
#[derive(Debug)]
pub struct SourceInfo {
/// The line number within the source file underpinned by `module_id`.
pub line_no: usize,
/// The ID of the module containing this token. This will be looked up in the global
/// hashmap of [`Module`]'s.
pub module_id: Uuid,
pub module: Module,
/// The indexes where this token may be found (line-local).
pub span: std::ops::Range<usize>,
}
impl Display for SourceInfo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.module.name)
}
}