Cフェーズ完了: AST優先ルート安定化 + MapBox.get()参照修正

- MapBox.get(): ArrayBox/MapBoxでshare_box()を返すよう修正
  - local変数経由のpush操作で参照が正しく保持される
- analysis_consumer.hako: method_spans初期化追加
  - 未初期化キーによる[map/missing]エラーを防止
  - local変数経由push(methods_arr, spans)で安全な操作確保
  - ASTキー両受け(boxes/uses後方互換)
- parser_core.hako: コード整形(可読性改善)

ベースラインテスト: HC011・HC016  all green

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-11-08 01:32:02 +09:00
parent 58a6471883
commit 1e5c146a87
3 changed files with 28 additions and 10 deletions

View File

@ -152,6 +152,13 @@ impl MapBox {
{
return value.share_box();
}
// Share identity for collection boxes to preserve mutability semantics
if value.as_any().downcast_ref::<ArrayBox>().is_some() {
return value.share_box();
}
if value.as_any().downcast_ref::<MapBox>().is_some() {
return value.share_box();
}
value.clone_box()
}
None => Box::new(StringBox::new(&format!("[map/missing] Key not found: {}", key_str))),