assembler: great leap forwards (more like the Cultural Revolution)

This commit is contained in:
2025-06-25 03:26:50 +01:00
parent ce76820b6d
commit 9232f2ccab
10 changed files with 172 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
//! 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`].
use uuid::Uuid;
/// 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,
/// The indexes where this token may be found (line-local).
pub span: std::ops::Range<usize>,
}