2025-10-31 19:16:05 +09:00
|
|
|
|
Hakorune Script Checker (MVP)
|
|
|
|
|
|
|
|
|
|
|
|
Purpose
|
|
|
|
|
|
- Quickly validate Hakorune source files by parsing → MIR build → MIR verify without executing.
|
|
|
|
|
|
- Useful while Python/llvmlite migration is in-flight to keep scripts healthy.
|
|
|
|
|
|
|
|
|
|
|
|
Usage
|
2025-10-31 19:22:00 +09:00
|
|
|
|
- Build once (auto-build if missing):
|
2025-10-31 19:16:05 +09:00
|
|
|
|
- cargo build --release
|
|
|
|
|
|
- Run checker:
|
|
|
|
|
|
- tools/hako-check/hako-check.sh path/to/file.hako
|
2025-10-31 19:22:00 +09:00
|
|
|
|
- or set alias explicitly: HAKO_BIN=tools/bin/hako tools/hako-check/hako-check.sh file.hako
|
2025-10-31 19:16:05 +09:00
|
|
|
|
|
|
|
|
|
|
Behavior
|
|
|
|
|
|
- Runs: nyash --backend mir --verify <file>
|
|
|
|
|
|
- Exit codes:
|
|
|
|
|
|
- 0: OK
|
|
|
|
|
|
- 2+: Parse/MIR verify failure (nyash returns non‑zero; checker forwards)
|
|
|
|
|
|
|
|
|
|
|
|
Notes
|
2025-10-31 19:22:00 +09:00
|
|
|
|
- Binary alias
|
|
|
|
|
|
- Preferred alias: tools/bin/hako (or tools/bin/hakorune)
|
|
|
|
|
|
- Backward‑compat: target/release/nyash も利用可(自動検出)
|
2025-10-31 19:16:05 +09:00
|
|
|
|
- This MVP only checks a single file and depends on the Rust parser.
|
|
|
|
|
|
- Extend with flags (parser selection, JSON emit) as migration progresses.
|