From 0e5324f0b0cb01f624bd28ff5b8a646000d33c96 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 13 Feb 2025 22:40:13 +0200 Subject: feat(assembler): Add instruction collapse code gen step --- assembler/src/parser/mod.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'assembler/src/parser/mod.rs') diff --git a/assembler/src/parser/mod.rs b/assembler/src/parser/mod.rs index af78478..5dbedf6 100644 --- a/assembler/src/parser/mod.rs +++ b/assembler/src/parser/mod.rs @@ -1,13 +1,15 @@ mod code_gen; mod syntax; +mod instruction; use std::collections::HashMap; use crate::Word; #[derive(Debug, Default)] -pub(crate) struct Instruction { - name: String, - args: Vec
, +pub(crate) struct Program { + definitions: HashMap, + constants: Vec, + instructions: Vec, } #[derive(Debug, Default, PartialEq, Eq, Clone)] @@ -28,9 +30,8 @@ impl Address { } } -#[derive(Debug, Default)] -pub(crate) struct Program { - definitions: HashMap, - constants: Vec, - instructions: Vec, +#[derive(Debug, Default, Clone)] +pub(crate) struct Instruction { + name: String, + args: Vec
, } -- cgit v1.3.1-26-gb76a