wip -- loadFromDevice
This commit is contained in:
@@ -1044,6 +1044,25 @@ impl<'a, W: std::io::Write> Compiler<'a, W> {
|
||||
|
||||
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!()
|
||||
|
||||
@@ -1057,7 +1057,7 @@ impl Parser {
|
||||
|
||||
Ok(SysCall::System(sys_call::System::LoadFromDevice(
|
||||
device,
|
||||
LiteralOrVariable::Variable(variable.clone()),
|
||||
Literal::String(variable.clone()),
|
||||
)))
|
||||
}
|
||||
"loadBatch" => {
|
||||
@@ -1202,4 +1202,3 @@ impl Parser {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ pub enum System {
|
||||
/// ## Examples
|
||||
/// `l r0 d0 Setting`
|
||||
/// `l r1 d5 Pressure`
|
||||
LoadFromDevice(LiteralOrVariable, LiteralOrVariable),
|
||||
LoadFromDevice(LiteralOrVariable, Literal),
|
||||
/// Function which gets a LogicType from all connected network devices that match
|
||||
/// the provided device hash and name, aggregating them via a batchMode
|
||||
/// ## In Game
|
||||
|
||||
Reference in New Issue
Block a user