mirror of
https://github.com/engineer-man/piston.git
synced 2025-06-08 03:06:26 +02:00
Merge pull request #124 from TitouanT/prolog_main
call main\1 predicate with arguments list if any
This commit is contained in:
commit
e7d2cd5f0e
1 changed files with 5 additions and 0 deletions
|
@ -5,4 +5,9 @@ cd /tmp/$1
|
||||||
sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' stdin.stdin |
|
sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' stdin.stdin |
|
||||||
cat code.code - > code.pl
|
cat code.code - > code.pl
|
||||||
|
|
||||||
|
if [ -s args.args ]
|
||||||
|
then
|
||||||
|
echo ":- main($(jq --raw-input -c --slurp 'split("\n")' args.args))." >> code.pl
|
||||||
|
fi
|
||||||
|
|
||||||
timeout -s KILL 3 swipl -g true -t halt code.pl
|
timeout -s KILL 3 swipl -g true -t halt code.pl
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue