From 7106c3f5ac353d3166211abb83086cc5aa6577fa Mon Sep 17 00:00:00 2001 From: 1computer1 Date: Fri, 15 Mar 2019 21:43:40 -0400 Subject: [PATCH] Add OCaml --- README.md | 1 + docker/ocaml/Dockerfile | 4 ++++ docker/ocaml/run.sh | 2 ++ src/languages/ocaml.js | 11 +++++++++++ 4 files changed, 18 insertions(+) create mode 100644 docker/ocaml/Dockerfile create mode 100644 docker/ocaml/run.sh create mode 100644 src/languages/ocaml.js diff --git a/README.md b/README.md index 5010766..0f0f818 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ Options are optionally set in `options`, which is a semicolon-delimited list of - `e` prints the result of evaluating the code - `kotlin` Kotlin (Kotlin 1.3) - `lua` Lua (Lua 5.3) +- `ocaml` OCaml (OCaml 4.0.6) - `pas` Pascal (FPC 3.0.4) - `php` PHP (PHP 7.3.3) - `pl` Perl (Perl 5.28.1) diff --git a/docker/ocaml/Dockerfile b/docker/ocaml/Dockerfile new file mode 100644 index 0000000..e332bb1 --- /dev/null +++ b/docker/ocaml/Dockerfile @@ -0,0 +1,4 @@ +FROM frolvlad/alpine-ocaml +LABEL author="1Computer1" + +COPY run.sh /var/run/ diff --git a/docker/ocaml/run.sh b/docker/ocaml/run.sh new file mode 100644 index 0000000..6e61446 --- /dev/null +++ b/docker/ocaml/run.sh @@ -0,0 +1,2 @@ +echo "$1" > program.ml +ocamlopt -cclib --static -o program program.ml && ./program diff --git a/src/languages/ocaml.js b/src/languages/ocaml.js new file mode 100644 index 0000000..a66b4e1 --- /dev/null +++ b/src/languages/ocaml.js @@ -0,0 +1,11 @@ +const Language = require('../struct/Language'); + +class OCaml extends Language { + constructor() { + super('ocaml', { + aliases: ['ocaml'] + }); + } +} + +module.exports = OCaml;