🎨 feat: EguiBox GUI開発基盤完成 + パーサー無限ループバグ修正

## 🚀 主要機能追加
### EguiBox - GUI開発基盤
- Windows版GUIメモ帳アプリ (simple_notepad.rs, nyash_notepad_jp.rs)
- 日本語フォント対応 (NotoSansJP-VariableFont_wght.ttf)
- BMPアイコン表示システム (c_drive_icon.bmp)
- Windowsエクスプローラー風アプリ (nyash_explorer.rs)
- アイコン抽出システム (test_icon_extraction.rs)

### ビジュアルプログラミング準備
- NyashFlow プロジェクト設計完成 (NYASHFLOW_PROJECT_HANDOVER.md)
- ビジュアルノードプロトタイプ基盤
- WebAssembly対応準備

## 🔧 重大バグ修正
### パーサー無限ループ問題 (3引数メソッド呼び出し)
- 原因: メソッドパラメータ解析ループの予約語処理不備
- 修正: src/parser/mod.rs - 非IDENTIFIERトークンのエラーハンドリング追加
- 効果: "from"等の予約語で適切なエラー報告、ハング→瞬時エラー

### MapBoxハング問題調査
- MapBox+3引数メソッド呼び出し組み合わせ問題特定
- バグレポート作成 (MAPBOX_HANG_BUG_REPORT.md)
- 事前評価vs必要時評価の設計問題明確化

## 🧹 コード品質向上
- box_methods.rs を8モジュールに機能分離
- 一時デバッグコード全削除 (eprintln\!, unsafe等)
- 構文チェック通過確認済み

## 📝 ドキュメント整備
- CLAUDE.md にGUI開発セクション追加
- Gemini/ChatGPT先生相談ログ保存 (sessions/)
- 段階的デバッグ手法確立

## 🎯 次の目標
- must_advance\!マクロ実装 (無限ループ早期検出)
- コマンド引数でデバッグ制御 (--debug-fuel)
- MapBox問題の根本修正

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-10 07:54:03 +09:00
parent a4d32b3c57
commit e7f6666917
92 changed files with 8206 additions and 78 deletions

View File

@ -9,6 +9,8 @@
use super::*;
use crate::boxes::null_box::NullBox;
use crate::boxes::console_box::ConsoleBox;
// use crate::boxes::intent_box_wrapper::IntentBoxWrapper;
use std::sync::Arc;
impl NyashInterpreter {
/// new式を実行 - Object creation engine
@ -111,6 +113,61 @@ impl NyashInterpreter {
let console_box = Box::new(ConsoleBox::new()) as Box<dyn NyashBox>;
return Ok(console_box);
}
// "IntentBox" => {
// // IntentBoxは引数なしで作成メッセージバス
// if !arguments.is_empty() {
// return Err(RuntimeError::InvalidOperation {
// message: format!("IntentBox constructor expects 0 arguments, got {}", arguments.len()),
// });
// }
// let intent_box = Arc::new(crate::boxes::IntentBox::new());
// let intent_box_wrapped = Box::new(IntentBoxWrapper {
// inner: intent_box
// }) as Box<dyn NyashBox>;
// return Ok(intent_box_wrapped);
// }
// "P2PBox" => {
// // P2PBoxは引数2個node_id, intent_boxで作成
// if arguments.len() != 2 {
// return Err(RuntimeError::InvalidOperation {
// message: format!("P2PBox constructor expects 2 arguments (node_id, intent_box), got {}", arguments.len()),
// });
// }
//
// // node_id
// let node_id_value = self.execute_expression(&arguments[0])?;
// let node_id = if let Some(id_str) = node_id_value.as_any().downcast_ref::<StringBox>() {
// id_str.value.clone()
// } else {
// return Err(RuntimeError::TypeError {
// message: "P2PBox constructor requires string node_id as first argument".to_string(),
// });
// };
//
// // intent_box
// let intent_box_value = self.execute_expression(&arguments[1])?;
// let intent_box = if let Some(wrapper) = intent_box_value.as_any().downcast_ref::<IntentBoxWrapper>() {
// wrapper.inner.clone()
// } else {
// return Err(RuntimeError::TypeError {
// message: "P2PBox constructor requires IntentBox as second argument".to_string(),
// });
// };
//
// let p2p_box = Box::new(crate::boxes::P2PBox::new(node_id, intent_box)) as Box<dyn NyashBox>;
// return Ok(p2p_box);
// }
#[cfg(not(target_arch = "wasm32"))]
"EguiBox" => {
// EguiBoxは引数なしで作成GUIアプリケーション用
if !arguments.is_empty() {
return Err(RuntimeError::InvalidOperation {
message: format!("EguiBox constructor expects 0 arguments, got {}", arguments.len()),
});
}
let egui_box = Box::new(crate::boxes::EguiBox::new()) as Box<dyn NyashBox>;
return Ok(egui_box);
}
#[cfg(target_arch = "wasm32")]
"WebDisplayBox" => {
// WebDisplayBoxは引数1個要素IDで作成ブラウザHTML操作用
@ -573,7 +630,13 @@ impl NyashInterpreter {
#[cfg(not(target_arch = "wasm32"))]
let is_web_box = false;
is_builtin || is_web_box ||
// GUI専用Box非WASM環境のみ
#[cfg(not(target_arch = "wasm32"))]
let is_gui_box = matches!(type_name, "EguiBox");
#[cfg(target_arch = "wasm32")]
let is_gui_box = false;
is_builtin || is_web_box || is_gui_box ||
// または登録済みのユーザー定義Box
self.shared.box_declarations.read().unwrap().contains_key(type_name)
}