From 81ce8fcf87df5f05ab7f569598a9d83641f1cfa8 Mon Sep 17 00:00:00 2001 From: Souji Date: Wed, 13 Mar 2019 07:22:58 +0100 Subject: [PATCH] Add F# --- README.md | 4 ++++ docker/fsharp/Dockerfile | 5 +++++ docker/fsharp/run.sh | 2 ++ src/languages/fsharp.js | 12 ++++++++++++ 4 files changed, 23 insertions(+) create mode 100644 docker/fsharp/Dockerfile create mode 100644 docker/fsharp/run.sh create mode 100644 src/languages/fsharp.js diff --git a/README.md b/README.md index 73d1350..1ed83e5 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ One of the following languages is set in `lang`. - `hs` Haskell (GHC 8.6.3) - `pas` Pascal (FPC 3.0.4) - `go` Go (Go 1.12) +- `fs` F# (FSharp 4.5) ## Options @@ -88,3 +89,6 @@ For Pascal: For Go: - None + +For F#: +- None diff --git a/docker/fsharp/Dockerfile b/docker/fsharp/Dockerfile new file mode 100644 index 0000000..311f936 --- /dev/null +++ b/docker/fsharp/Dockerfile @@ -0,0 +1,5 @@ +FROM fsharp +LABEL author="1Computer1" + +COPY run.sh /var/run/ +WORKDIR /var/ws diff --git a/docker/fsharp/run.sh b/docker/fsharp/run.sh new file mode 100644 index 0000000..8bf2b3b --- /dev/null +++ b/docker/fsharp/run.sh @@ -0,0 +1,2 @@ +echo "$1" > program.fsx +fsharpi --optimize- --exec program.fsx diff --git a/src/languages/fsharp.js b/src/languages/fsharp.js new file mode 100644 index 0000000..b730ab2 --- /dev/null +++ b/src/languages/fsharp.js @@ -0,0 +1,12 @@ +const Language = require('../struct/Language'); + +class FSharp extends Language { + constructor() { + super('fsharp', { + highlight: 'fs', + aliases: ['fsharp', 'f#', 'fs'] + }); + } +} + +module.exports = FSharp;