🚀 feat: ":"継承演算子実装+全14Box型の包括的ドキュメント化完成

## 🔧 言語機能改善
- from予約語問題を解決する":"継承演算子を実装
- box Child : Parent 構文でより直感的な継承表現
- tokenizer/parserを更新、from を変数名として使用可能に

## 📚 ドキュメント大改善(1000行以上追加)
全14Box型に包括的なJavaDoc風ドキュメントを追加:
- StringBox: 文字列操作メソッド群
- IntegerBox/BoolBox: 基本データ型と演算子
- MathBox/RandomBox/TimeBox: 計算・ユーティリティ
- ConsoleBox/DebugBox/SoundBox: システムIO
- MapBox/NullBox: データ構造
- EguiBox: デスクトップGUI
- SimpleIntentBox: P2P通信

各Boxに概要・メソッド一覧・使用例・実用例・注意事項を完備

## 🧹 プロジェクト整理
- ルートディレクトリから60個のテストファイルを削除
  (development/root_tests/に移動済み)
- 不要ファイル削除: bmp, tar.xz, html, 空フォルダ等
- examplesフォルダへ適切なファイルを移動

## 📝 その他の更新
- CLAUDE.md: パーサーデバッグ機能の説明追加
- sessions/: AI相談記録2件を保存
  - from予約語問題の解決策検討
  - 標準Box型(ArrayBox等)の設計相談
This commit is contained in:
Moe Charm
2025-08-10 11:32:32 +09:00
parent e7f6666917
commit ccb3204a35
89 changed files with 1536 additions and 3027 deletions

View File

@ -1,3 +1,104 @@
/*! 🔍 DebugBox - デバッグ支援Box
*
* ## 📝 概要
* プロフェッショナル開発向けデバッグ機能を提供するBox。
* メモリ使用量監視、実行トレース、ブレークポイントなど
* 高度なデバッグ機能を完備。
*
* ## 🛠️ 利用可能メソッド
*
* ### 🎯 基本デバッグ
* - `startTracking()` - デバッグ追跡開始
* - `stopTracking()` - デバッグ追跡停止
* - `trackBox(box, name)` - 特定Boxを追跡対象に追加
* - `watch(box, name)` - リアルタイム監視
* - `clear()` - 全デバッグ情報クリア
*
* ### 📊 レポート・分析
* - `dumpAll()` - 全追跡データダンプ
* - `memoryReport()` - メモリ使用量レポート
* - `showCallStack()` - 関数呼び出しスタック表示
* - `saveToFile(filename)` - デバッグ情報をファイル保存
*
* ### 🎮 高度機能
* - `setBreakpoint(function)` - ブレークポイント設定
* - `traceCall(function, args)` - 関数呼び出しトレース
* - `isTracking()` - 追跡状態確認
* - `getTrackedCount()` - 追跡中Box数取得
*
* ## 💡 使用例
* ```nyash
* local debug, user, product
* debug = new DebugBox()
*
* // デバッグ開始
* debug.startTracking()
*
* // オブジェクトを追跡
* user = new User("Alice", 25)
* debug.trackBox(user, "user_alice")
*
* product = new Product("Book", 1500)
* debug.trackBox(product, "book_product")
*
* // リアルタイム監視
* debug.watch(user.age, "user_age")
*
* // レポート生成
* print(debug.memoryReport())
* print(debug.dumpAll())
*
* // ファイルに保存
* debug.saveToFile("debug_report.txt")
* ```
*
* ## 🎮 実用例 - パフォーマンス診断
* ```nyash
* static box PerformanceTest {
* init { debug, data, results }
*
* main() {
* me.debug = new DebugBox()
* me.debug.startTracking()
*
* // 大量データ処理のテスト
* me.data = []
* loop(i < 1000) {
* me.data.push("item_" + i.toString())
* }
* me.debug.trackBox(me.data, "large_array")
*
* // 処理実行
* me.processData()
*
* // 結果分析
* print(me.debug.memoryReport())
* }
* }
* ```
*
* ## ⚡ ベストプラクティス
* ```nyash
* // エラーハンドリング付きデバッグ
* local debug
* debug = new DebugBox()
*
* try {
* debug.startTracking()
* // 問題のあるコード
* risky_operation()
* } catch (error) {
* debug.saveToFile("error_dump.txt")
* print("Debug info saved to error_dump.txt")
* }
* ```
*
* ## ⚠️ 注意
* - 本格運用時はtrackingを無効にしてパフォーマンス向上
* - 大量データ追跡時はメモリ消費に注意
* - call stackは直近100件まで自動保持
*/
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use chrono::Local;