|
|
e9c7d27a7f
|
feat(joinir): Phase 30.x jsonir v0 - JoinIR JSON serialization
Implement JSON serialization for JoinIR module.
Implementation:
- src/mir/join_ir/json.rs: JSON serializer (~250 lines, no external deps)
- src/tests/joinir_json_min.rs: Integration tests (8 unit + 2 integration)
- 10 tests total, all passing
Features:
- JoinModule → JSON serialization
- All instruction types: Call, Jump, Ret, Compute
- All MirLikeInst types: Const, BinOp, Compare, BoxCall
- Full ConstValue support: Integer, Bool, String, Null
- Full operator coverage: Add/Sub/Mul/Div/Or/And, Lt/Le/Gt/Ge/Eq/Ne
- JSON string escaping for special characters
Usage:
use crate::mir::join_ir::json::join_module_to_json_string;
let json = join_module_to_json_string(&module);
Non-goals (this phase):
- CLI flag (--emit-joinir-json)
- JSON → JoinIR reverse conversion
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-11-25 09:53:26 +09:00 |
|