add prolog language support

This commit is contained in:
TitouanT 2021-02-14 17:19:45 +01:00
parent 0c4c6e7ad5
commit d805f1a46e
6 changed files with 39 additions and 0 deletions

9
lxc/executors/prolog Normal file
View file

@ -0,0 +1,9 @@
#!/bin/bash
# cd /tmp/$1
sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' input.input |
cat code.code - > code.pl
timeout -s KILL 3 swipl -g true -t halt code.pl

View file

@ -52,6 +52,8 @@ echo -n 'testing perl = '
../../cli/execute perl perl.pl
echo -n 'testing php = '
../../cli/execute php php.php
echo -n 'testing prolog = '
../../cli/execute prolog prolog.pl
echo -n 'testing python2 = '
../../cli/execute python2 python2.py
echo -n 'testing python3 = '

1
lxc/tests/prolog.pl Normal file
View file

@ -0,0 +1 @@
:- write('good'), nl.

View file

@ -105,6 +105,10 @@ echo 'php'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "php -v"
echo '---'
echo 'prolog'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "swipl --version"
echo '---'
echo 'python2'
lxc-attach --clear-env -n piston -- /bin/bash -l -c "python -V"
echo '---'