Add asm::Value::Void

This commit is contained in:
Andrew Morris
2023-03-05 07:27:59 +11:00
parent 6df5bccf9c
commit 372d9c9b36
2 changed files with 3 additions and 0 deletions

View File

@@ -410,6 +410,7 @@ impl Instruction {
}
pub enum Value {
Void,
Undefined,
Null,
Boolean(bool),
@@ -424,6 +425,7 @@ pub enum Value {
impl std::fmt::Display for Value {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Value::Void => write!(f, "void"),
Value::Undefined => write!(f, "undefined"),
Value::Null => write!(f, "null"),
Value::Boolean(value) => write!(f, "{}", value),

View File

@@ -183,6 +183,7 @@ impl Assembler {
false => self.output.push(ValueType::False as u8),
true => self.output.push(ValueType::True as u8),
},
Value::Void => self.output.push(ValueType::Void as u8),
Value::Null => self.output.push(ValueType::Null as u8),
Value::Undefined => self.output.push(ValueType::Undefined as u8),
Value::Array(array) => self.array(array),