Phase 3 complete: DateTimeBox fully implemented and tested

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-11 20:38:39 +00:00
parent 738a026466
commit 2d3b6adf09
5 changed files with 55 additions and 3 deletions

View File

@ -11,6 +11,7 @@
use super::*;
use crate::box_trait::StringBox;
use crate::boxes::{TimeBox, DateTimeBox};
impl NyashInterpreter {
/// TimeBoxのメソッド呼び出しを実行
@ -171,6 +172,14 @@ impl NyashInterpreter {
}
Ok(datetime_box.addHours(arg_values[0].clone_box()))
}
"toString" => {
if !arg_values.is_empty() {
return Err(RuntimeError::InvalidOperation {
message: format!("toString() expects 0 arguments, got {}", arg_values.len()),
});
}
Ok(Box::new(datetime_box.to_string_box()))
}
_ => {
Err(RuntimeError::InvalidOperation {
message: format!("Unknown DateTimeBox method: {}", method),