diff --git a/libs/compiler/src/test/syscall.rs b/libs/compiler/src/test/syscall.rs
index 03f4f57..f833639 100644
--- a/libs/compiler/src/test/syscall.rs
+++ b/libs/compiler/src/test/syscall.rs
@@ -81,3 +81,29 @@ fn test_set_on_device() -> anyhow::Result<()> {
Ok(())
}
+
+#[test]
+fn test_load_from_device() -> anyhow::Result<()> {
+ let compiled = compile! {
+ debug
+ r#"
+ device airCon = "d0";
+
+ let setting = loadFromDevice(airCon, "On");
+ "#
+ };
+
+ assert_eq!(
+ compiled,
+ indoc! {
+ "
+ j main
+ main:
+ l r15 d0 On
+ move r8 r15 #setting
+ "
+ }
+ );
+
+ Ok(())
+}
diff --git a/libs/compiler/src/v1.rs b/libs/compiler/src/v1.rs
index 27c0632..370f02e 100644
--- a/libs/compiler/src/v1.rs
+++ b/libs/compiler/src/v1.rs
@@ -154,11 +154,7 @@ impl<'a, W: std::io::Write> Compiler<'a, W> {
Ok(None)
}
Expression::Syscall(SysCall::System(system_syscall)) => {
- let res = self.expression_syscall_system(system_syscall, scope)?;
- Ok(res.map(|l| CompilationResult {
- location: l,
- temp_name: None,
- }))
+ self.expression_syscall_system(system_syscall, scope)
}
Expression::While(expr_while) => {
self.expression_while(expr_while, scope)?;
@@ -177,11 +173,7 @@ impl<'a, W: std::io::Write> Compiler<'a, W> {
Ok(None)
}
Expression::Declaration(var_name, expr) => {
- let loc = self.expression_declaration(var_name, *expr, scope)?;
- Ok(loc.map(|l| CompilationResult {
- location: l,
- temp_name: None,
- }))
+ self.expression_declaration(var_name, *expr, scope)
}
Expression::Assignment(assign_expr) => {
self.expression_assignment(assign_expr, scope)?;
@@ -292,23 +284,26 @@ impl<'a, W: std::io::Write> Compiler<'a, W> {
var_name: String,
expr: Expression,
scope: &mut VariableScope<'v>,
- ) -> Result