-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg(brachylog-1.0.0): added brachylog
- Loading branch information
1 parent
e95d386
commit 8d32385
Showing
7 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# build prolog 8.2.4 as dependency | ||
source ../../prolog/8.2.4/build.sh | ||
|
||
# curl brachylog 1.0.0 | ||
curl -L "https://github.com/JCumin/Brachylog/archive/refs/tags/v1.0-ascii.tar.gz" -o brachylog.tar.gz | ||
tar xzf brachylog.tar.gz --strip-components=1 | ||
rm brachylog.tar.gz | ||
|
||
# move swi prolog to working directory | ||
cp bin/swipl swipl | ||
|
||
# give execution permission to swipl | ||
chmod +x swipl | ||
|
||
# add some code the branchylog.pl so we don't have to escape backslashes while using the interactive mode | ||
echo ' | ||
:-feature(argv, [Code, Stdin]), run_from_atom(Code, Stdin, _), halt.' >> prolog_parser/brachylog.pl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Put 'export' statements here for environment variables | ||
export PATH=$PWD/bin:$PATH | ||
export BRACHYLOG_PATH=$PWD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"language": "brachylog", | ||
"version": "1.0.0", | ||
"aliases": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"OK"w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -325,6 +325,7 @@ Content-Type: application/json | |
`awk`, | ||
`bash`, | ||
`befunge93`, | ||
`brachylog`, | ||
`brainfuck`, | ||
`c`, | ||
`c++`, | ||
|