Skip to content

Commit

Permalink
Fix eval statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed Jan 27, 2025
1 parent fb8df4b commit 1ce9ee2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/icy_board_engine/src/vm/statements/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ pub async fn run_predefined_statement(opcode: OpCode, arg: &mut VirtualMachine<'
OpCode::DGET => predefined_procedures::dget(arg, arguments).await,
OpCode::DPUT => predefined_procedures::dput(arg, arguments).await,
OpCode::DFCOPY => predefined_procedures::dfcopy(arg, arguments).await,
OpCode::EVAL => { predefined_procedures::eval(arg, arguments).await },
OpCode::ACCOUNT => predefined_procedures::account(arg, arguments).await,
OpCode::RECORDUSAGE => predefined_procedures::recordusage(arg, arguments).await,
OpCode::MSGTOFILE => predefined_procedures::msgtofile(arg, arguments).await,
Expand All @@ -232,7 +233,7 @@ pub async fn run_predefined_statement(opcode: OpCode, arg: &mut VirtualMachine<'
OpCode::KILLMSG => predefined_procedures::killmsg(arg, arguments).await,
OpCode::CHDIR => predefined_procedures::chdir(arg, arguments).await,
OpCode::MKDIR => predefined_procedures::mkdir(arg, arguments).await,
OpCode::RMDIR => predefined_procedures::rmdir(arg, arguments).await,
OpCode::RMDIR => predefined_procedures::redir(arg, arguments).await,
OpCode::FDOWRAKA => predefined_procedures::fdowraka(arg, arguments).await,
OpCode::FDOADDAKA => predefined_procedures::fdoaddaka(arg, arguments).await,
OpCode::FDOWRORG => predefined_procedures::fdowrorg(arg, arguments).await,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ pub async fn invalid(vm: &mut VirtualMachine<'_>, args: &[PPEExpr]) -> Res<()> {
panic!("Invalid statement");
}

pub async fn eval(vm: &mut VirtualMachine<'_>, args: &[PPEExpr]) -> Res<()> {
vm.eval_expr(&args[0]).await?;
Ok(())
}

pub async fn end(vm: &mut VirtualMachine<'_>, args: &[PPEExpr]) -> Res<()> {
vm.is_running = false;
Ok(())
Expand Down

0 comments on commit 1ce9ee2

Please sign in to comment.