selfhost(pyvm): MiniVmPrints – prefer JSON route early-return (ok==1) to avoid fallback loops; keep default behavior unchanged elsewhere

This commit is contained in:
Selfhosting Dev
2025-09-22 07:54:25 +09:00
parent 27568eb4a6
commit 8e4cadd349
348 changed files with 9981 additions and 30074 deletions

View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
# Pre-expand dev sugar: line-head "@name[: Type] = expr" -> "local name[: Type] = expr"
# Usage:
# tools/dev/at_local_preexpand.sh < input.nyash > output.nyash
# or tools/dev/at_local_preexpand.sh input.nyash > output.nyash
in="${1:-}"
if [ -n "$in" ]; then
exec <"$in"
fi
sed -E 's/^([[:space:]]*)@([A-Za-z_][A-Za-z0-9_]*)([[:space:]]*:[[:space:]]*[A-Za-z_][A-Za-z0-9_]*)?[[:space:]]*=/\1local \2\3 =/'