diff --git a/libs/compiler/src/v1.rs b/libs/compiler/src/v1.rs index dd93cfd..27c0632 100644 --- a/libs/compiler/src/v1.rs +++ b/libs/compiler/src/v1.rs @@ -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!() diff --git a/libs/parser/src/lib.rs b/libs/parser/src/lib.rs index 308a4d6..6747da8 100644 --- a/libs/parser/src/lib.rs +++ b/libs/parser/src/lib.rs @@ -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 { } } } - diff --git a/libs/parser/src/sys_call.rs b/libs/parser/src/sys_call.rs index cb306ca..6b97107 100644 --- a/libs/parser/src/sys_call.rs +++ b/libs/parser/src/sys_call.rs @@ -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