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
omega-mv / train / aien-train / native / omegese45 / translate / main-rep2en.om
| 1 | note SPDX-License-Identifier: AGPL-3.0-only |
| 2 | note rep2en driver: rep2en FACTS_TSV, stdin = the G line then the P line. |
| 3 | note stdout: one English sentence (exit 0), `G2E_CONTRADICT <what>` (exit |
| 4 | note 30) or `G2E_INVALID <what>` (exit 31). Exit 2: usage (not exactly one |
| 5 | note argument) or a stdin read/stdout write error. |
| 6 | fn main to int |
| 7 | if ne argcnt 2 |
| 8 | otpfr 19 |
| 9 | otflush |
| 10 | ret 2 |
| 11 | end |
| 12 | k = otrdin |
| 13 | if eq k neg long 2 |
| 14 | ret 2 |
| 15 | end |
| 16 | if lt k 0 |
| 17 | put otol 0 0 |
| 18 | otpfr 18 |
| 19 | otpfr 31 |
| 20 | otflush |
| 21 | ret 31 |
| 22 | end |
| 23 | code = otrepen ulong k |
| 24 | otflush |
| 25 | ret code |
| 26 | end |