Merge pull request #236 from catwell/pull-1

Support Lua 5.3
This commit is contained in:
Steve J Donovan 2016-06-19 11:17:19 +02:00 committed by GitHub
commit dd44ad1ef5
1 changed files with 19 additions and 6 deletions

View File

@ -3,6 +3,7 @@
local tools = require 'ldoc.tools'
local globals = {}
local lua52 = _VERSION:match '5.2'
local lua53 = _VERSION:match '5.3'
globals.functions = {
@ -33,12 +34,12 @@ globals.functions = {
}
local functions = globals.functions
if not lua52 then
if lua52 or lua53 then
functions.rawlen = true
else
functions.setfenv = true
functions.getfenv = true
functions.unpack = true
else
functions.rawlen = true
end
local manual, fun_ref
@ -48,7 +49,19 @@ function globals.set_manual_url(url)
fun_ref = manual..'pdf-'
end
if lua52 then
if lua53 then
globals.tables = {
io = '6.8',
package = '6.3',
math = '6.7',
os = '6.9',
string = '6.4',
table = '6.6',
coroutine = '6.2',
debug = '6.10'
}
globals.set_manual_url 'https://www.lua.org/manual/5.3/manual.html'
elseif lua52 then
globals.tables = {
io = '6.8',
package = '6.3',
@ -59,7 +72,7 @@ if lua52 then
coroutine = '6.2',
debug = '6.10'
}
globals.set_manual_url 'http://www.lua.org/manual/5.2/manual.html'
globals.set_manual_url 'https://www.lua.org/manual/5.2/manual.html'
else
globals.tables = {
io = '5.7',
@ -71,7 +84,7 @@ else
coroutine = '5.2',
debug = '5.9'
}
globals.set_manual_url 'http://www.lua.org/manual/5.1/manual.html'
globals.set_manual_url 'https://www.lua.org/manual/5.1/manual.html'
end
local file_methods = {