Files
hakorune/local_tests/test_mir_26_instructions.nyash
Moe Charm 3df87fb1ce fix(phase-4.3c-3): Fix StringBox literal handling in MIR builder
Phase 4-3c-3 Complete: WASM host functions now correctly output string content

## Changes:
- Fixed MIR builder to handle StringBox with string literal arguments
- Special case for  to generate proper string constants
- Removed debug output after successful verification
- WASM now correctly outputs "Hello MIR!" instead of "StringBox"

## Test Results:
- MIR generation:  Generates  correctly
- WASM compilation:  String data correctly placed at offset 4096
- WASM execution:  Outputs "Hello MIR\!" as expected

## Technical Details:
- Modified build_new_expression() to detect StringBox with literal arguments
- Generates Const instruction with actual string content
- Host function reads StringBox memory layout correctly

This completes the WASM string output functionality for Phase 4.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-17 13:49:35 +09:00

30 lines
747 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MIR 26命令セット完全動作確認テスト
# Phase 4-3: 新しい26命令セットの基本テスト
# 基本演算テスト
result = 10 + 5
print("Basic arithmetic: " + result)
# 比較演算テスト
comparison = (result > 12)
print("Comparison result: " + comparison)
# 条件分岐テスト
if comparison {
print("Conditional branch works")
}
# ループテスト
counter = 0
loop(counter < 3) {
print("Loop iteration: " + counter)
counter = counter + 1
}
# Box作成・アクセステスト基本的なEverything is Box
local testBox = new MapBox()
testBox.set("key1", "value1")
local value = testBox.get("key1")
print("Box operation result: " + value)
print("MIR 26 instruction test completed successfully!")