From 981bb70e5077bd30ef85a0092117a875dcc614fc Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Tue, 14 Oct 2025 20:40:39 +1300 Subject: Implement new intermediate stage Massive improvement. Label references can be used anywhere in the program, with the program being assembled repeatedly until all labels have stabilised. The bytecode stage will just be a tiny stage tacked onto the end, rather than the old bytecode stage that would resolve labels and expressions. --- src/stages/compiler.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/stages/compiler.rs') diff --git a/src/stages/compiler.rs b/src/stages/compiler.rs index 1476ec8..b4680c2 100644 --- a/src/stages/compiler.rs +++ b/src/stages/compiler.rs @@ -16,10 +16,12 @@ pub fn parse_symbols(source_code: &str, path: Option<&Path>) -> Option syntactic, Err(_errors) => return None, }; + let semantic = match parse_semantic(syntactic) { Ok(semantic) => semantic, Err(_errors) => return None, }; + // Convert symbols to the format required by the assembler library. let parsed = SymbolParser::new().parse(&semantic); let mut symbols = Vec::new(); -- cgit v1.2.3-70-g09d2