diff --git a/backend/src/langs.ts b/backend/src/langs.ts index 5722564..f0a73ed 100644 --- a/backend/src/langs.ts +++ b/backend/src/langs.ts @@ -3238,6 +3238,22 @@ PLEASE LIKE AND SUBSCRIBE input: `echo "$x"`, }, template: `echo "Hello, world!" +`, + }, + teco: { + aliases: ["mung"], + name: "TECO", + repl: "teco", + input: `123*234=\x1b\x1b`, + main: "main.txt", + compile: "cat main.txt | teco-encode > main.teco", + run: "mung main.teco", + scope: { + code: `123*234UX$$`, + input: `QX=\x1b\x1b`, + }, + template: `IHello, world! +$HT$$ `, }, tex: { diff --git a/scripts/docker-install-phase6.bash b/scripts/docker-install-phase6.bash index da190bf..95d3fb4 100755 --- a/scripts/docker-install-phase6.bash +++ b/scripts/docker-install-phase6.bash @@ -147,6 +147,16 @@ module.exports = { tokenize, Parser, Environment }; EOF popd >/dev/null +# TECO +git clone https://github.com/blakemcbride/TECOC.git +pushd TECOC/src >/dev/null +make -f makefile.linux +mv tecoc /usr/local/bin/tecoc +ln -s /usr/local/bin/tecoc /usr/local/bin/teco +ln -s /usr/local/bin/tecoc /usr/local/bin/mung +popd >/dev/null +rm -rf TECOC + # Thue wget -nv "$(curl -sSL https://catseye.tc/distribution/Thue_distribution | grep -Eo 'https://catseye.tc/distfiles/thue-[^"]+\.zip' | head -n1)" unzip thue-*.zip diff --git a/scripts/docker-install-phase7.bash b/scripts/docker-install-phase7.bash index 742e467..9c10d0e 100755 --- a/scripts/docker-install-phase7.bash +++ b/scripts/docker-install-phase7.bash @@ -237,6 +237,20 @@ const env = new lang.Environment(runtime); env.run(ast); EOF +# TECO +tee /usr/local/bin/teco-encode >/dev/null <<"EOF" +#!/usr/bin/env -S python3 -u + +import re +import sys + +for line in sys.stdin: + line = re.sub(r"\^(.)", lambda m: chr(ord(m.group(1)) ^ 0b1000000), line) + line = line.replace("$", chr(27)) + print(line, end="") +EOF +chmod +x /usr/local/bin/teco-encode + # Unlambda tee /usr/local/bin/unlambda-repl >/dev/null <<"EOF" #!/usr/bin/env python3