🎁 feat: pack構文革命完全達成 - Box哲学の具現化

【実装内容】
- packキーワード追加: TokenType::PACK, "pack" mapping
- パーサー対応: init同様の特別扱い + from Parent.pack()
- インタープリター対応: pack > init > Box名順優先選択
- デリゲーション統合: from Parent.pack()で親packを呼び出し
- テスト完備: test_pack_syntax.nyash包括テスト

【革命的効果】
- Box哲学具現化: 「箱に詰める」でコードを書くたび哲学体験
- 他言語差別化: new/init超越のNyash独自アイデンティティ
- 直感的UX: Gemini・ChatGPT両先生一致推薦の最適命名
- メンタルモデル統一: 全Boxで1つのpack動詞に収束
- 拡張基盤: try_pack, from_*パターンへの発展準備完了

🎉 Everything is Box - Now Everything is Packed\!

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-11 09:40:24 +09:00
parent e3d4b3cbd5
commit 50fc4ca1ce
7 changed files with 366 additions and 40 deletions

View File

@ -32,6 +32,7 @@ pub enum TokenType {
THIS,
ME,
INIT, // init (初期化ブロック)
PACK, // pack (コンストラクタ)
NOWAIT, // nowait
AWAIT, // await
INTERFACE, // interface
@ -390,6 +391,7 @@ impl NyashTokenizer {
"this" => TokenType::THIS,
"me" => TokenType::ME,
"init" => TokenType::INIT,
"pack" => TokenType::PACK,
"nowait" => TokenType::NOWAIT,
"await" => TokenType::AWAIT,
"interface" => TokenType::INTERFACE,