assembler: add join()
This commit is contained in:
parent
35760d76ce
commit
2f0ae5e2a5
1 changed files with 5 additions and 0 deletions
|
@ -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) );
|
||||||
|
|
Loading…
Reference in a new issue