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/ng/front/cases/nom-wrap.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 / ng / front / cases / nom-wrap.sh` 26 lines ยท 1085 bytes Raw Blame History 1 #!/bin/sh 2 # SPDX-License-Identifier: Apache-2.0 3 # Regenerates the wrapped struct run units nom_.om from seed/omc/tests/struct/.om. 4 # ng front-ir lowers only `fn main to int`; these fixtures return uint, ulong or long, so main becomes `subject` 5 # and a new `fn main to int` returns it as an int. Run from the repository root: 6 # sh seed/ng/front/cases/nom-wrap.sh [check] 7 # With `check` nothing is written: exit 1 if a copy differs from what the originals generate. 8 set -e 9 bad=0 10 for n in t1 t1x t1y t2 t4 t5 t6 t7 t7b t8 t9; do 11 src=seed/omc/tests/struct/$n.om 12 out=seed/ng/front/cases/nom_$n.om 13 tmp=$(mktemp) 14 { 15 printf 'note Wrapped copy of %s for gate-front-ir: main to uint, ulong or long becomes subject (nom-wrap.sh).\n' "$src" 16 sed 's/^fn main to \(uint\|ulong\|long\)$/fn subject to \1/' "$src" 17 printf 'fn main to int\nret int subject\nend\n' 18 } > "$tmp" 19 if [ "$1" = check ]; then 20 cmp -s "$tmp" "$out" || { echo "differs: $out"; bad=1; } 21 rm -f "$tmp" 22 else 23 mv "$tmp" "$out" 24 fi 25 done 26 exit $bad