From 27cb99d10ab700ec00cc621bc3469c4affbf5c3b Mon Sep 17 00:00:00 2001 From: 1computer1 Date: Fri, 15 Mar 2019 20:32:30 -0400 Subject: [PATCH] Add Lua --- README.md | 1 + docker/lua/Dockerfile | 6 ++++++ docker/lua/run.sh | 2 ++ src/languages/lua.js | 11 +++++++++++ 4 files changed, 20 insertions(+) create mode 100644 docker/lua/Dockerfile create mode 100644 docker/lua/run.sh create mode 100644 src/languages/lua.js diff --git a/README.md b/README.md index e3eea20..ec3d1db 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 +- `lua` (Lua 5.3) - `pas` Pascal (FPC 3.0.4) - `php` PHP (PHP 7.3.3) - `pl` Perl (Perl 5.28.1) diff --git a/docker/lua/Dockerfile b/docker/lua/Dockerfile new file mode 100644 index 0000000..0835675 --- /dev/null +++ b/docker/lua/Dockerfile @@ -0,0 +1,6 @@ +FROM alpine + +RUN apk update +RUN apk add lua5.3 + +COPY run.sh /var/run/ diff --git a/docker/lua/run.sh b/docker/lua/run.sh new file mode 100644 index 0000000..39c3e24 --- /dev/null +++ b/docker/lua/run.sh @@ -0,0 +1,2 @@ +echo "$1" > program.lua +lua5.3 program.lua diff --git a/src/languages/lua.js b/src/languages/lua.js new file mode 100644 index 0000000..f630ece --- /dev/null +++ b/src/languages/lua.js @@ -0,0 +1,11 @@ +const Language = require('../struct/Language'); + +class Lua extends Language { + constructor() { + super('lua', { + aliases: ['lua'] + }); + } +} + +module.exports = Lua;