diff --git a/examples/rule110.mcl b/examples/rule110.mcl index 8d10732..ae869cb 100755 --- a/examples/rule110.mcl +++ b/examples/rule110.mcl @@ -3,14 +3,14 @@ mem 98 + 1 @8 0 while dup 98 < do 0 while dup 100 < do dup mem + !8 if - dup mem + 100 + 42 @8 + dup mem + 100 + "*" @8 else - dup mem + 100 + 32 @8 + dup mem + 100 + " " @8 end 1 + end - mem + 100 + 10 @8 + mem + 100 + "\n" @8 101 mem 100 + 1 1 syscall3 drop diff --git a/src/compile/commands.rs b/src/compile/commands.rs index f2c9847..d2f2785 100644 --- a/src/compile/commands.rs +++ b/src/compile/commands.rs @@ -60,14 +60,14 @@ pub fn linux_x86_64_compile_and_link(of_a: &PathBuf, of_o: &PathBuf, of_c: &Path Ok(()) } -pub fn linux_x86_64_run(_bin: &PathBuf, args: Vec, quiet: bool) -> Result<()> { +pub fn linux_x86_64_run(_bin: &PathBuf, args: Vec, quiet: bool) -> Result { let bin = PathBuf::from( format!("./{}", _bin.to_string_lossy()) ); let mut proc = if cfg!(target_os = "windows") { - return Ok(()); + return Ok(0); } else { Command::new(bin) .args(&args) @@ -84,5 +84,5 @@ pub fn linux_x86_64_run(_bin: &PathBuf, args: Vec, quiet: bool) -> Resul logger::info(format!("{} process exited with code {}", _bin.to_string_lossy(), exit).as_str()); } - Ok(()) + Ok(exit.code().unwrap_or(0)) } \ No newline at end of file