add EmptyTable constant

maybe it shouldn’t be there though...
This commit is contained in:
numzero 2025-04-19 15:01:00 +03:00
parent 843c65ca16
commit 0f3ad28aae
3 changed files with 3 additions and 0 deletions

View File

@ -53,6 +53,7 @@ pub enum Constant {
Boolean(bool),
Number(i64),
String(String),
EmptyTable,
}
impl Location {

View File

@ -68,6 +68,7 @@ impl Eval for Constant {
Constant::Boolean(value) => Some(ValueInner::Boolean(*value)),
Constant::Number(value) => Some(ValueInner::Number(*value)),
Constant::String(value) => Some(ValueInner::String(value.clone())),
Constant::EmptyTable => Some(ValueInner::Table(Default::default())),
}
}
}

View File

@ -291,6 +291,7 @@ impl Eval for ast::Constant {
ast::Constant::Boolean(value) => Some(types::ValueInner::Boolean(*value)),
ast::Constant::Number(value) => Some(types::ValueInner::Number(*value)),
ast::Constant::String(value) => Some(types::ValueInner::String(value.clone())),
ast::Constant::EmptyTable => Some(types::ValueInner::Table(Default::default())),
}
}
}