pkg(brachylog-1.0.0): added brachylog

This commit is contained in:
Hydrazer 2021-11-28 07:03:57 -07:00
parent e95d386697
commit 8d32385b41
7 changed files with 52 additions and 1 deletions

19
packages/brachylog/1.0.0/run vendored Normal file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
# save the file for later
file="$1"
# remove the file from $@
shift
# save stdin as $@ joined by newlines
stdin=`printf "%s\n" "$@"`
# save code as the contents of $file
code=`cat "$file"`
# go to the directory where brachylog.pl is so the imports work
cd "$BRACHYLOG_PATH"/prolog_parser
# run swi prolog with code and stdin
swipl -f brachylog.pl "$code" "$stdin"