wip -- loadFromDevice

This commit is contained in:
2025-11-25 18:08:31 -07:00
parent adea9b6977
commit 96645cbff3
3 changed files with 21 additions and 3 deletions

View File

@@ -1044,6 +1044,25 @@ impl<'a, W: std::io::Write> Compiler<'a, W> {
Ok(None) Ok(None)
} }
System::LoadFromDevice(device, logic_type) => {
let LiteralOrVariable::Variable(device) = device else {
return Err(Error::AgrumentMismatch(
"Arg1 expected to be a variable".into(),
));
};
let Some(device) = self.devices.get(&device) else {
return Err(Error::InvalidDevice(device));
};
let Literal::String(logic_type) = logic_type else {
return Err(Error::AgrumentMismatch(
"Arg2 expected to be a string".into(),
));
};
todo!()
}
_ => { _ => {
todo!() todo!()

View File

@@ -1057,7 +1057,7 @@ impl Parser {
Ok(SysCall::System(sys_call::System::LoadFromDevice( Ok(SysCall::System(sys_call::System::LoadFromDevice(
device, device,
LiteralOrVariable::Variable(variable.clone()), Literal::String(variable.clone()),
))) )))
} }
"loadBatch" => { "loadBatch" => {
@@ -1202,4 +1202,3 @@ impl Parser {
} }
} }
} }

View File

@@ -113,7 +113,7 @@ pub enum System {
/// ## Examples /// ## Examples
/// `l r0 d0 Setting` /// `l r0 d0 Setting`
/// `l r1 d5 Pressure` /// `l r1 d5 Pressure`
LoadFromDevice(LiteralOrVariable, LiteralOrVariable), LoadFromDevice(LiteralOrVariable, Literal),
/// Function which gets a LogicType from all connected network devices that match /// Function which gets a LogicType from all connected network devices that match
/// the provided device hash and name, aggregating them via a batchMode /// the provided device hash and name, aggregating them via a batchMode
/// ## In Game /// ## In Game