assembler: we failing DSA with this one
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user