aboutsummaryrefslogtreecommitdiff
path: root/nomsu.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-24 16:43:06 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-24 16:43:56 -0700
commitb1c0446a3c65e8e22a9ecfd9d24213a2b9eac22b (patch)
treecfd6658dc826f6d8fc15e64d34bc3a2736b59fb0 /nomsu.moon
parent6014c5aa439d4b4ae0b97af64825371a86e78c2c (diff)
Updating file stuff for better compatibility with Lua 5.2 and fixing
some bugs. Also updated README to provide more compatibility info and list Lua5.2+ as a requirement.
Diffstat (limited to 'nomsu.moon')
-rwxr-xr-xnomsu.moon9
1 files changed, 8 insertions, 1 deletions
diff --git a/nomsu.moon b/nomsu.moon
index 44bdf65..bf6a1f6 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -1,5 +1,13 @@
#!/usr/bin/env moon
-- This file contains the command-line Nomsu runner.
+
+EXIT_SUCCESS, EXIT_FAILURE = 0, 1
+
+if _VERSION == "Lua 5.1" and not jit
+ -- Cannot run on Lua5.1 because it doesn't have gotos.
+ print("Sorry, Nomsu does not run on Lua 5.1. Please use LuaJIT 2+ or Lua 5.2+")
+ os.exit(EXIT_FAILURE)
+
if NOMSU_VERSION and NOMSU_PREFIX
ver_bits = [ver_bit for ver_bit in NOMSU_VERSION\gmatch("[0-9]+")]
partial_vers = [table.concat(ver_bits,'.',1,i) for i=#ver_bits,1,-1]
@@ -9,7 +17,6 @@ if NOMSU_VERSION and NOMSU_PREFIX
else
package.nomsupath = "."
-EXIT_SUCCESS, EXIT_FAILURE = 0, 1
usage = [=[
Nomsu Compiler