pyvm: split op handlers into ops_core/ops_box/ops_ctrl; add ops_flow + intrinsic; delegate vm.py without behavior change
net-plugin: modularize constants (consts.rs) and sockets (sockets.rs); remove legacy commented socket code; fix unused imports mir: move instruction unit tests to tests/mir_instruction_unit.rs (file lean-up); no semantic changes runner/pyvm: ensure using pre-strip; misc docs updates Build: cargo build ok; legacy cfg warnings remain as before
This commit is contained in:
21
tools/test/smoke/parser/not_operator_smoke.sh
Normal file
21
tools/test/smoke/parser/not_operator_smoke.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "$0")"/../../../.. && pwd)
|
||||
bin="$root/target/release/nyash"
|
||||
src="$root/apps/tests/sugar/not_basic.nyash"
|
||||
|
||||
if [ ! -x "$bin" ]; then
|
||||
echo "nyash binary not found at $bin; build first (cargo build --release)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export NYASH_VM_USE_PY=1
|
||||
export NYASH_ENTRY_ALLOW_TOPLEVEL_MAIN=1
|
||||
out=$("$bin" --backend vm "$src" 2>&1 | sed '/^\[entry\] Warning/d')
|
||||
# Expect lines: 1 then 0
|
||||
line1=$(printf '%s\n' "$out" | sed -n '1p')
|
||||
line2=$(printf '%s\n' "$out" | sed -n '2p')
|
||||
test "$line1" = "1" || { echo "[FAIL] not on 0 expected 1, got '$line1'" >&2; echo "$out" >&2; exit 2; }
|
||||
test "$line2" = "0" || { echo "[FAIL] not on 1 expected 0, got '$line2'" >&2; echo "$out" >&2; exit 2; }
|
||||
echo "[OK] not-operator smoke passed"
|
||||
12
tools/test/smoke/parser/semicolon_accept_smoke.sh
Normal file
12
tools/test/smoke/parser/semicolon_accept_smoke.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "$0")"/../../../.. && pwd)
|
||||
bin="$root/target/release/nyash"
|
||||
prog="$root/apps/tests/parser/semicolon_basic.nyash"
|
||||
|
||||
out=$(NYASH_PARSER_ALLOW_SEMICOLON=1 NYASH_VM_USE_PY=1 "$bin" --backend vm "$prog")
|
||||
expected=$'A\nB'
|
||||
test "$out" = "$expected" || { echo "[FAIL] semicolon_accept expected '$expected', got '$out'" >&2; exit 2; }
|
||||
echo "[OK] semicolon_accept"
|
||||
|
||||
26
tools/test/smoke/parser/semicolon_else_edge_smoke.sh
Normal file
26
tools/test/smoke/parser/semicolon_else_edge_smoke.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "$0")"/../../../.. && pwd)
|
||||
bin="$root/target/release/nyash"
|
||||
src="$root/apps/tests/parser/semicolon_else_edge.nyash"
|
||||
|
||||
if [ ! -x "$bin" ]; then
|
||||
echo "nyash binary not found at $bin; build first (cargo build --release)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export NYASH_PARSER_ALLOW_SEMICOLON=1
|
||||
|
||||
set +e
|
||||
err=$("$bin" --backend vm "$src" 2>&1 >/dev/null)
|
||||
code=$?
|
||||
set -e
|
||||
|
||||
if [ "$code" -eq 0 ]; then
|
||||
echo "[FAIL] parser accepted forbidden '} ; else' boundary"
|
||||
exit 2
|
||||
fi
|
||||
echo "$err" | rg -qi 'parse error' || { echo "[FAIL] parser did not report parse error" >&2; echo "$err" >&2; exit 2; }
|
||||
echo "[OK] parser semicolon else-edge smoke passed"
|
||||
|
||||
Reference in New Issue
Block a user