From 2f0ae5e2a551142a1dc05d926a7c9126878836e2 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Thu, 9 May 2024 15:31:52 +0200 Subject: [PATCH] assembler: add join() --- src/assembler.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/assembler.rs b/src/assembler.rs index 7447bcf..74a3049 100644 --- a/src/assembler.rs +++ b/src/assembler.rs @@ -41,6 +41,11 @@ impl Assembler { self.words } + pub fn join(mut self, mut other: Assembler) -> Self { + self.words.append(&mut other.words); + self + } + pub fn lit(mut self, w: VM_Word) -> Assembler { self.words.push( AssemblyWord::inst(VM_Instruction::Lit) ); self.words.push( AssemblyWord::lit(w) );