Add Julia

This commit is contained in:
1computer1 2019-03-15 20:24:49 -04:00
parent c8048b3a08
commit b1ecae7841
4 changed files with 33 additions and 0 deletions

View file

@ -69,6 +69,8 @@ Options are optionally set in `options`, which is a semicolon-delimited list of
- `js` JavaScript (Node 11.11.0)
- `harmony` enables harmony features (`--harmony` on node)
- `e` prints the result of evaluating the code
- `julia` Julia (Julia 1.1.0)
- `e` prints the result of evaluating the code
- `pas` Pascal (FPC 3.0.4)
- `php` PHP (PHP 7.3.3)
- `pl` Perl (Perl 5.28.1)

4
docker/julia/Dockerfile Normal file
View file

@ -0,0 +1,4 @@
FROM julia
LABEL author="1Computer1"
COPY run.sh /var/run/

5
docker/julia/run.sh Normal file
View file

@ -0,0 +1,5 @@
if [ "$EVAL_EXPR" = "true" ]; then
julia -E "$1"
else
julia -e "$1"
fi

22
src/languages/julia.js Normal file
View file

@ -0,0 +1,22 @@
const Language = require('../struct/Language');
class Julia extends Language {
constructor() {
super('julia', {
aliases: ['julia'],
options: {
e: () => ''
}
});
}
runWith(options) {
if (options.has('e')) {
return { id: this.id, env: { EVAL_EXPR: 'true' } };
}
return super.runWith(options);
}
}
module.exports = Julia;