selfhost(pyvm): MiniVmPrints – prefer JSON route early-return (ok==1) to avoid fallback loops; keep default behavior unchanged elsewhere
This commit is contained in:
14
tools/dev/at_local_preexpand.sh
Normal file
14
tools/dev/at_local_preexpand.sh
Normal 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 =/'
|
||||
Reference in New Issue
Block a user