From 80da2af821385b2fc89091e9ac37a047349da4bd Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Wed, 5 Feb 2025 12:58:02 +1300 Subject: Implement source unit compilation, symbol resolution, error reporting This library can now carry out all stages of assembly from collecting source fragments to resolving symbols to pruning unused libraries to generating a single compiled source file. Pretty-printing of state has also been implemented in this library. The source tree hierarchy, symbol resolution errors, and file read errors can all be printed in a tidy format. --- src/context.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/context.rs (limited to 'src/context.rs') diff --git a/src/context.rs b/src/context.rs new file mode 100644 index 0000000..c015c7e --- /dev/null +++ b/src/context.rs @@ -0,0 +1,8 @@ +use crate::*; + + +/// Source context for a token. +pub struct Context<'a> { + pub source_code: &'a str, + pub source: &'a SourceSpan, +} -- cgit v1.2.3-70-g09d2