print(_VERSION) -- Output Lua 5.2
UPD:其他方法来区分Lua版本:
if _ENV then -- Lua 5.2 else -- Lua 5.1 end if 9^33 == 27^22 then -- this check is valid for x86/x64 only -- vanilla Lua else -- LuaJIT end