Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/omc/gate9.sh # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / omc / gate9.sh` 50 lines ยท 1392 bytes Raw Blame History 1 #!/bin/sh 2 # gate9.sh -- grouping parentheses (OMEGESE 3). The lexer splits '(' and ')' even when they touch a 3 # value, and a group returns exactly the value inside it. seed/out/omc is the compiler under test. 4 # RC=0 only when every case below ran and passed. 5 set -eu 6 R=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd) 7 cd "$R" 8 B=build/seed/r9 9 T=seed/omc/tests/paren 10 S=seed/out/omc 11 mkdir -p "$B" 12 [ -x "$S" ] || { printf 'FAIL: %s missing; run sh seed/omega-from-seed.sh first\n' "$S" >&2; exit 1; } 13 bad() { printf 'FAIL: %s\n' "$*" >&2; exit 1; } 14 say() { printf '%s\n' "$*"; } 15 16 n=0 17 run_exit() { # name expect 18 n=$((n+1)) 19 set +e 20 "$S" < "$T/$1.om" > "$B/$1.bin" 2> "$B/$1.err" 21 crc=$? 22 set -e 23 [ "$crc" = 0 ] || bad "$1: compiler exit $crc ($(cat "$B/$1.err"))" 24 chmod +x "$B/$1.bin" 25 set +e 26 "$B/$1.bin" > /dev/null 27 rrc=$? 28 set -e 29 [ "$rrc" = "$2" ] || bad "$1: ran $rrc, wanted $2" 30 say "PASS $1 exit $rrc" 31 } 32 33 refuse() { # name expect-error 34 n=$((n+1)) 35 set +e 36 "$S" < "$T/$1.om" > "$B/$1.bin" 2> "$B/$1.err" 37 crc=$? 38 set -e 39 [ "$crc" = "$2" ] || bad "$1: compiler exit $crc, wanted $2 ($(cat "$B/$1.err"))" 40 grep -q "error $2" "$B/$1.err" || bad "$1: diagnostic does not name error $2" 41 say "PASS $1 error $2" 42 } 43 44 run_exit basic 0 45 run_exit float 4 46 refuse neg_ambiguous 11 47 refuse neg_unclosed 16 48 49 say "PASS gate9 $n cases" 50 exit 0