🔧 refactor: P2PBox複雑実装を削除し段階的実装方針に変更

- 複雑なP2PBox関連実装を削除:
  * Transport trait + MessageBus + MessageIntentBox + NewP2PBox
  * 依存関係が複雑で一度に追加すると失敗することを学習

- nyashバイナリのビルドを安定化:
  * 全てのimportエラーを修正
  * cargo build --bin nyash が正常に動作

- CURRENT_TASK.mdに新しい段階的実装方針を記載:
  * Phase 1: FloatBox (依存なし)
  * Phase 2: ArrayBox改良
  * Phase 3: 演算子システム改良

- 教訓: 一つずつ確実に実装し、テストファーストで進める

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-12 04:02:19 +09:00
parent 3876b83e26
commit 19cfe70df9
15 changed files with 165 additions and 1730 deletions

View File

@ -8,7 +8,7 @@
use super::*;
use crate::ast::UnaryOperator;
use crate::boxes::{buffer::BufferBox, JSONBox, HttpClientBox, StreamBox, RegexBox, IntentBox, P2PBox, NewP2PBox, MessageIntentBox};
use crate::boxes::{buffer::BufferBox, JSONBox, HttpClientBox, StreamBox, RegexBox, IntentBox, P2PBox};
use crate::boxes::{MathBox, ConsoleBox, TimeBox, RandomBox, SoundBox, DebugBox, file::FileBox, MapBox};
use crate::operator_traits::OperatorResolver;
// TODO: Fix NullBox import issue later
@ -747,7 +747,7 @@ impl NyashInterpreter {
"TimeBox" | "DateTimeBox" | "TimerBox" | "RandomBox" | "SoundBox" |
"DebugBox" | "MethodBox" | "NullBox" | "ConsoleBox" | "FloatBox" |
"BufferBox" | "RegexBox" | "JSONBox" | "StreamBox" | "HTTPClientBox" |
"IntentBox" | "P2PBox" | "NewP2PBox" | "MessageIntentBox" | "EguiBox"
"IntentBox" | "P2PBox" | "EguiBox"
);
if is_builtin {
@ -941,26 +941,6 @@ impl NyashInterpreter {
message: format!("P2PBox delegation not yet fully implemented: {}.{}", parent, method),
});
}
"NewP2PBox" => {
// NewP2PBoxの場合、current_instanceから実際のNewP2PBoxインスタンスを取得
if let Some(p2p_box) = current_instance.as_any().downcast_ref::<NewP2PBox>() {
self.execute_new_p2p_box_method(p2p_box, method, arguments)
} else {
Err(RuntimeError::TypeError {
message: format!("Expected NewP2PBox instance for method call {}.{}", parent, method),
})
}
}
"MessageIntentBox" => {
// MessageIntentBoxの場合、current_instanceから実際のMessageIntentBoxインスタンスを取得
if let Some(message_box) = current_instance.as_any_mut().downcast_mut::<MessageIntentBox>() {
self.execute_message_intent_box_method(message_box, method, arguments)
} else {
Err(RuntimeError::TypeError {
message: format!("Expected MessageIntentBox instance for method call {}.{}", parent, method),
})
}
}
"FileBox" => {
let file_box = crate::boxes::file::FileBox::new();
self.execute_file_method(&file_box, method, arguments)