feat: Prepare for code modularization and cleanup
- Archive old documentation and test files to `docs/archive/` and `local_tests/`. - Remove various temporary and old files from the project root. - Add `nekocode-rust` analysis tool and its output files (`nekocode/`, `.nekocode_sessions/`, `analysis.json`). - Minor updates to `apps/chip8_nyash/chip8_emulator.nyash` and `local_tests` files. This commit cleans up the repository and sets the stage for further code modularization efforts, particularly in the `src/interpreter` and `src/parser` modules, based on recent analysis.
This commit is contained in:
61
local_tests/test_pack_transparency_final.nyash
Normal file
61
local_tests/test_pack_transparency_final.nyash
Normal file
@ -0,0 +1,61 @@
|
||||
# 🔥 Phase 8.8: pack透明化システム 最終統合テスト
|
||||
# 全機能の協調動作確認
|
||||
|
||||
print("=== pack透明化システム最終統合テスト開始 ===")
|
||||
|
||||
# 1. 従来のbirth機能(ユーザー定義Box)
|
||||
box Animal {
|
||||
init { name, species }
|
||||
|
||||
birth(animalName, animalSpecies) {
|
||||
me.name = animalName
|
||||
me.species = animalSpecies
|
||||
}
|
||||
|
||||
introduce() {
|
||||
return me.name + " は " + me.species + " です"
|
||||
}
|
||||
}
|
||||
|
||||
# 2. pack透明化(ビルトインBox継承)
|
||||
box SmartString from StringBox {
|
||||
init { metadata }
|
||||
|
||||
birth(content, meta) {
|
||||
from StringBox(content) # 透明化
|
||||
me.metadata = meta
|
||||
}
|
||||
|
||||
getInfo() {
|
||||
return "内容の情報: " + me.metadata
|
||||
}
|
||||
}
|
||||
|
||||
# 3. 複数のビルトインBox透明化
|
||||
box Calculator from MathBox {
|
||||
init { precision }
|
||||
|
||||
birth(precisionLevel) {
|
||||
from MathBox.birth() # Explicit syntax after Phase 8.9
|
||||
me.precision = precisionLevel
|
||||
}
|
||||
|
||||
getPrecision() {
|
||||
return "精度: " + me.precision
|
||||
}
|
||||
}
|
||||
|
||||
# テスト実行
|
||||
print("1. ユーザー定義Box:")
|
||||
local cat = new Animal("ミケ", "猫")
|
||||
print(cat.introduce())
|
||||
|
||||
print("2. StringBox透明化:")
|
||||
local smartStr = new SmartString("Hello World", "UTF-8")
|
||||
print(smartStr.getInfo())
|
||||
|
||||
print("3. MathBox透明化:")
|
||||
local calc = new Calculator("高精度")
|
||||
print(calc.getPrecision())
|
||||
|
||||
print("=== 全テスト成功!pack透明化システム完了 ===")テム完了 ===")
|
||||
Reference in New Issue
Block a user