assembler: add join()

This commit is contained in:
Michael Sippel 2024-05-09 15:31:52 +02:00
parent 35760d76ce
commit 2f0ae5e2a5
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -41,6 +41,11 @@ impl Assembler {
self.words 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 { pub fn lit(mut self, w: VM_Word) -> Assembler {
self.words.push( AssemblyWord::inst(VM_Instruction::Lit) ); self.words.push( AssemblyWord::inst(VM_Instruction::Lit) );
self.words.push( AssemblyWord::lit(w) ); self.words.push( AssemblyWord::lit(w) );