diff --git a/README.md b/README.md index 93c21d6..08289df 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ One of the following languages is set in `lang`. - `js` JavaScript (Node 10.14.2) - `py` Python (CPython 3.6.8) - `hs` Haskell (GHC 8.4.3) +- `pas` Pascal (FPC 3.0.4) ## Options @@ -76,6 +77,9 @@ For Python: For Haskell: - None +For Pascal: +- None + ## Packages Apart from the standard libraries, some other libraries come pre-installed. @@ -100,3 +104,6 @@ For Haskell: - scientific - split - vector + +For Pascal: +- None \ No newline at end of file diff --git a/docker/go/Dockerfile b/docker/go/Dockerfile new file mode 100644 index 0000000..5ddd8dd --- /dev/null +++ b/docker/go/Dockerfile @@ -0,0 +1,5 @@ +FROM golang:alpine +LABEL author="1Computer1" + +COPY run.sh /var/run/ +WORKDIR /var/ws diff --git a/docker/go/run.sh b/docker/go/run.sh new file mode 100644 index 0000000..0e12614 --- /dev/null +++ b/docker/go/run.sh @@ -0,0 +1,2 @@ +echo "$1" > program.go +go run program.go diff --git a/docker/pascal/Dockerfile b/docker/pascal/Dockerfile new file mode 100644 index 0000000..79a6413 --- /dev/null +++ b/docker/pascal/Dockerfile @@ -0,0 +1,5 @@ +FROM frolvlad/alpine-fpc +LABEL author="SpaceEEC" + +COPY run.sh /var/run/ +WORKDIR /var/ws diff --git a/docker/pascal/run.sh b/docker/pascal/run.sh new file mode 100644 index 0000000..4903b85 --- /dev/null +++ b/docker/pascal/run.sh @@ -0,0 +1,11 @@ +echo "$1" > program.pas + +# fpc does not use stderr, ld however does, capture both +res="$(fpc program.pas 2>&1)" + +if [ $? -eq 0 ]; then + ./program +else + echo "$res" + exit 1 +fi diff --git a/src/commands/help.js b/src/commands/help.js index bce5de6..da2700c 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -31,6 +31,7 @@ class HelpCommand extends Command { '- JavaScript', '- Python', '- Haskell', + '- Go', '', 'Read the readme for more information: ' ]); diff --git a/src/languages/go.js b/src/languages/go.js new file mode 100644 index 0000000..f8c8d4d --- /dev/null +++ b/src/languages/go.js @@ -0,0 +1,12 @@ +const Language = require('../struct/Language'); + +class Go extends Language { + constructor() { + super('go', { + highlight: 'go', + aliases: ['go'] + }); + } +} + +module.exports = Go; diff --git a/src/languages/pascal.js b/src/languages/pascal.js new file mode 100644 index 0000000..6aca115 --- /dev/null +++ b/src/languages/pascal.js @@ -0,0 +1,12 @@ +const Language = require('../struct/Language'); + +class Pascal extends Language { + constructor() { + super('pascal', { + highlight: 'pas', + aliases: ['pascal', 'pas'] + }); + } +} + +module.exports = Pascal;