feat: using system完全実装完了!nyashstdビルトイン名前空間対応

 実装内容:
- ビルトイン名前空間解決: nyashstd → builtin:nyashstd
- 自動コード生成: static box群(string/integer/bool/array/console)
- 環境変数デフォルト化: NYASH_ENABLE_USING, NYASH_RESOLVE_FIX_BRACES, NYASH_LLVM_USE_HARNESS

 動作確認:
- パース→解決→読み込み→コード生成の全段階が正常動作
- 環境変数8個→6個に削減(25%改善)

 主要変更:
- src/runner/pipeline.rs: builtin namespace特別処理追加
- src/runner/modes/common_util/resolve/strip.rs: builtin:プレフィックス処理
- src/config/env.rs: 3つの環境変数をデフォルトON化

🎯 次: Mini-VM開発でusing nyashstd活用可能

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Selfhosting Dev
2025-09-23 12:39:35 +09:00
parent bbc581a07f
commit b7a3e129bd
4 changed files with 116 additions and 23 deletions

View File

@ -133,7 +133,12 @@ pub fn verify_edge_copy_strict() -> bool {
// ---- LLVM harness toggle (llvmlite) ----
pub fn llvm_use_harness() -> bool {
std::env::var("NYASH_LLVM_USE_HARNESS").ok().as_deref() == Some("1")
// Phase 15: デフォルトONLLVMバックエンドはPythonハーネス使用
// NYASH_LLVM_USE_HARNESS=0 で明示的に無効化可能
match std::env::var("NYASH_LLVM_USE_HARNESS").ok().as_deref() {
Some("0") | Some("false") | Some("off") => false,
_ => true, // デフォルト: ONハーネス使用
}
}
// ---- Phase 11.8 MIR cleanup toggles ----
@ -323,7 +328,20 @@ pub fn cli_verbose() -> bool {
std::env::var("NYASH_CLI_VERBOSE").ok().as_deref() == Some("1")
}
pub fn enable_using() -> bool {
std::env::var("NYASH_ENABLE_USING").ok().as_deref() == Some("1")
// Phase 15: デフォルトONusing systemはメイン機能
// NYASH_ENABLE_USING=0 で明示的に無効化可能
match std::env::var("NYASH_ENABLE_USING").ok().as_deref() {
Some("0") | Some("false") | Some("off") => false,
_ => true, // デフォルト: ON
}
}
pub fn resolve_fix_braces() -> bool {
// Phase 15: デフォルトONusing時のブレース均等修正が必須
// NYASH_RESOLVE_FIX_BRACES=0 で明示的に無効化可能
match std::env::var("NYASH_RESOLVE_FIX_BRACES").ok().as_deref() {
Some("0") | Some("false") | Some("off") => false,
_ => enable_using(), // using有効時は自動でON
}
}
pub fn vm_use_py() -> bool {
std::env::var("NYASH_VM_USE_PY").ok().as_deref() == Some("1")