diff --git a/croissant/do.lua b/croissant/do.lua index 2fb9192..a031f72 100644 --- a/croissant/do.lua +++ b/croissant/do.lua @@ -319,26 +319,7 @@ local function appendToDebugHistory(code) end end -local function luaVersion() - local f = function() - return function() - end - end - - local t = { - nil, - [false] = "Lua 5.1", - [true] = "Lua 5.2", - [1/"-0"] = "Lua 5.3", - [1] = "LuaJIT" - } - - return t[1] or t[1/0] or t[f() == f()] -end - local function banner() - local version = luaVersion() - if tonumber(_VERSION:match("Lua (%d+)")) < 5 or tonumber(_VERSION:match("Lua %d+%.(%d+)")) < 1 then print(colors.red "Croissant requires at least Lua 5.1") @@ -347,9 +328,9 @@ local function banner() print( "🥐 Croissant 0.0.1 (C) 2019 Benoit Giannangeli\n" - .. version .. (version:match "^LuaJIT" - and " Copyright (C) 2005-2017 Mike Pall. http://luajit.org/" - or " Copyright (C) 1994-2018 Lua.org, PUC-Rio") + .. (type(jit) == "table" + and jit.version + or ("PUC-Rio " .. _VERSION)) ) end