macroctx: pass ctx JSON (caps) to user macros; add demo macro; docs: MacroCtx section and sandbox Box API; golden for for/foreach normalized AST

This commit is contained in:
Selfhosting Dev
2025-09-20 09:11:52 +09:00
parent daa5309ea9
commit 497da75f90
14 changed files with 188 additions and 506 deletions

View File

@ -13,7 +13,7 @@ Compiles a Nyash program with the LLVM backend to an object (.o),
links it with the NyRT static runtime, and produces a native executable.
Options:
-o <output> Output executable name (default: app)
-o <output> Output executable path (default: tmp/app)
Requirements:
- LLVM 18 development (llvm-config-18)
@ -24,7 +24,7 @@ USAGE
if [[ $# -lt 1 ]]; then usage; exit 1; fi
INPUT=""
OUT="app"
OUT="tmp/app"
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help) usage; exit 0 ;;
@ -129,6 +129,8 @@ else
( cd crates/nyrt && cargo build --release -j 24 >/dev/null )
fi
# Ensure output directory exists
mkdir -p "$(dirname "$OUT")"
echo "[4/4] Linking $OUT ..."
cc "$OBJ" \
-L target/release \