From 5113f512b493f7bd54f67e52eb79d472ccb1163b Mon Sep 17 00:00:00 2001 From: 1computer1 Date: Fri, 15 Mar 2019 20:53:44 -0400 Subject: [PATCH] Add Kotlin --- README.md | 1 + docker/kotlin/Dockerfile | 4 ++++ docker/kotlin/run.sh | 3 +++ src/languages/kotlin.js | 11 +++++++++++ 4 files changed, 19 insertions(+) create mode 100644 docker/kotlin/Dockerfile create mode 100644 docker/kotlin/run.sh create mode 100644 src/languages/kotlin.js diff --git a/README.md b/README.md index 4c4a1b3..5010766 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ Options are optionally set in `options`, which is a semicolon-delimited list of - `e` prints the result of evaluating the code - `julia` Julia (Julia 1.1.0) - `e` prints the result of evaluating the code +- `kotlin` Kotlin (Kotlin 1.3) - `lua` Lua (Lua 5.3) - `pas` Pascal (FPC 3.0.4) - `php` PHP (PHP 7.3.3) diff --git a/docker/kotlin/Dockerfile b/docker/kotlin/Dockerfile new file mode 100644 index 0000000..cea9e98 --- /dev/null +++ b/docker/kotlin/Dockerfile @@ -0,0 +1,4 @@ +FROM kotlin:jdk12-alpine +LABEL author="1Computer1" + +COPY run.sh /var/run/ diff --git a/docker/kotlin/run.sh b/docker/kotlin/run.sh new file mode 100644 index 0000000..4c10111 --- /dev/null +++ b/docker/kotlin/run.sh @@ -0,0 +1,3 @@ +echo "$1" > program.kt +kotlinc program.kt -include-runtime -d program.jar +java -jar program.jar diff --git a/src/languages/kotlin.js b/src/languages/kotlin.js new file mode 100644 index 0000000..6a665f6 --- /dev/null +++ b/src/languages/kotlin.js @@ -0,0 +1,11 @@ +const Language = require('../struct/Language'); + +class Kotlin extends Language { + constructor() { + super('kotlin', { + aliases: ['kotlin'] + }); + } +} + +module.exports = Kotlin;