mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Add asm::Value::Void
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user