Compare commits

...

1 Commits

Author SHA1 Message Date
0f3ad28aae add EmptyTable constant
maybe it shouldn’t be there though...
2025-04-19 15:01:00 +03:00
3 changed files with 3 additions and 0 deletions

View File

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

View File

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