code builder initial

This commit is contained in:
NikVolf
2017-04-07 15:45:52 +03:00
parent 28aa6e9682
commit c0f0f2b571
3 changed files with 44 additions and 0 deletions

View File

@ -15,6 +15,11 @@ impl Opcodes {
Opcodes(elements)
}
/// Empty expression with only `Opcode::End` opcode
pub fn empty() -> Self {
Opcodes(vec![Opcode::End])
}
/// List of individual opcodes
pub fn elements(&self) -> &[Opcode] { &self.0 }
}