maat_span
Source span and location types for the Maat compiler.
Role
maat_span is the foundation of all error reporting in the compiler pipeline. Every token, AST node, and bytecode instruction carries a Span so that parse errors, type errors, and runtime panics can point back to the exact byte range in the original source file. SourceMap extends this to bytecode by mapping instruction offsets to their originating spans.
Usage
use ;
// Create a span covering bytes 4..7
let span = new;
// Merge two spans into one covering both ranges
let a = new;
let b = new;
let merged = a.merge; // Span { start: 0, end: 8 }
// Record instruction-to-source mappings for VM error messages
let mut map = new;
map.insert;
assert_eq!;
API Docs
Repository
github.com/maatlabs/maat. See the project README for an overview of the full compiler pipeline.