Accept expressions for the slotIndex in the slot logic syscalls

This commit is contained in:
2025-12-21 15:59:40 -07:00
parent 15752fde3d
commit 93873dfa93
3 changed files with 13 additions and 41 deletions

View File

@@ -2233,10 +2233,7 @@ impl<'a> Compiler<'a> {
System::LoadSlot(dev_name, slot_index, logic_type) => {
let (dev_hash, hash_cleanup) =
self.compile_literal_or_variable(dev_name.node, scope)?;
let (slot_index, slot_cleanup) = self.compile_literal_or_variable(
LiteralOrVariable::Literal(slot_index.node),
scope,
)?;
let (slot_index, slot_cleanup) = self.compile_operand(*slot_index, scope)?;
let (logic_type, logic_cleanup) = self.compile_literal_or_variable(
LiteralOrVariable::Literal(logic_type.node),
scope,
@@ -2261,10 +2258,7 @@ impl<'a> Compiler<'a> {
System::SetSlot(dev_name, slot_index, logic_type, var) => {
let (dev_name, name_cleanup) =
self.compile_literal_or_variable(dev_name.node, scope)?;
let (slot_index, index_cleanup) = self.compile_literal_or_variable(
LiteralOrVariable::Literal(slot_index.node),
scope,
)?;
let (slot_index, index_cleanup) = self.compile_operand(*slot_index, scope)?;
let (logic_type, type_cleanup) = self.compile_literal_or_variable(
LiteralOrVariable::Literal(logic_type.node),
scope,