🚀 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,4 +1,43 @@
// BoolBox implementation - Boolean values in Nyash
/*! BoolBox - 真偽値Box
*
* ## 📝 概要
* true/false値を扱うためのBox。
* JavaScript Boolean型のように直感的な論理演算が可能。
*
* ## 🛠️ 利用可能メソッド
* - `toString()` - 文字列変換 ("true" / "false")
* - `not()` - 論理NOT (演算子: not)
* - `and(other)` - 論理AND (演算子: and)
* - `or(other)` - 論理OR (演算子: or)
* - `equals(other)` - 等価比較 (演算子: ==)
*
* ## 💡 使用例
* ```nyash
* local flag, result, text
* flag = true
*
* result = not flag // false
* result = flag and true // true
* result = flag or false // true
* text = flag.toString() // "true"
*
* // 条件分岐での利用
* if (flag) {
* print("Flag is true!")
* }
* ```
*
* ## 🔄 型変換
* - 数値への変換: true → 1, false → 0
* - 文字列への変換: "true" / "false"
* - 空文字・null・0は false として扱われる
*
* ## ⚡ 論理演算子実装済み
* - `not condition` - NOT演算子
* - `a and b` - AND演算子
* - `a or b` - OR演算子
*/
use crate::box_trait::NyashBox;
use std::any::Any;
use std::fmt::Display;