diff options
| Commit | 0e5324f0b0cb01f624bd28ff5b8a646000d33c96 (patch) | |
|---|---|---|
| Author | 2025-02-13 22:40:13 +0200 | |
| Committer | 2025-02-13 22:40:13 +0200 | |
| Files | c90bea68ca0ee94f9cfe190bcda2b9cd78e6a56e /assembler/src/parser/mod.rs | |
| tonkobali-0e5324f0b0cb01f624bd28ff5b8a646000d33c96.tar tonkobali-0e5324f0b0cb01f624bd28ff5b8a646000d33c96.tar.gz tonkobali-0e5324f0b0cb01f624bd28ff5b8a646000d33c96.zip | ||
| Parent | d17f1356cbe20f8c464668c74a2eb005643b80ba (diff) | |
feat(assembler): Add instruction collapse code gen step
1 files changed, 9 insertions, 8 deletions
| -rw-r--r-- | assembler/src/parser/mod.rs | 17 |
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<Address>, +pub(crate) struct Program { + definitions: HashMap<String, Address>, + constants: Vec<Word>, + instructions: Vec<Instruction>, } #[derive(Debug, Default, PartialEq, Eq, Clone)] @@ -28,9 +30,8 @@ impl Address { } } -#[derive(Debug, Default)] -pub(crate) struct Program { - definitions: HashMap<String, Address>, - constants: Vec<Word>, - instructions: Vec<Instruction>, +#[derive(Debug, Default, Clone)] +pub(crate) struct Instruction { + name: String, + args: Vec<Address>, } |
