Codebase list lua-ldoc / dd44ad1
Merge pull request #236 from catwell/pull-1 Support Lua 5.3 Steve J Donovan authored 7 years ago GitHub committed 7 years ago
1 changed file(s) with 19 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
22 local tools = require 'ldoc.tools'
33 local globals = {}
44 local lua52 = _VERSION:match '5.2'
5 local lua53 = _VERSION:match '5.3'
56
67
78 globals.functions = {
3233 }
3334 local functions = globals.functions
3435
35 if not lua52 then
36 if lua52 or lua53 then
37 functions.rawlen = true
38 else
3639 functions.setfenv = true
3740 functions.getfenv = true
3841 functions.unpack = true
39 else
40 functions.rawlen = true
4142 end
4243
4344 local manual, fun_ref
4748 fun_ref = manual..'pdf-'
4849 end
4950
50 if lua52 then
51 if lua53 then
52 globals.tables = {
53 io = '6.8',
54 package = '6.3',
55 math = '6.7',
56 os = '6.9',
57 string = '6.4',
58 table = '6.6',
59 coroutine = '6.2',
60 debug = '6.10'
61 }
62 globals.set_manual_url 'https://www.lua.org/manual/5.3/manual.html'
63 elseif lua52 then
5164 globals.tables = {
5265 io = '6.8',
5366 package = '6.3',
5871 coroutine = '6.2',
5972 debug = '6.10'
6073 }
61 globals.set_manual_url 'http://www.lua.org/manual/5.2/manual.html'
74 globals.set_manual_url 'https://www.lua.org/manual/5.2/manual.html'
6275 else
6376 globals.tables = {
6477 io = '5.7',
7083 coroutine = '5.2',
7184 debug = '5.9'
7285 }
73 globals.set_manual_url 'http://www.lua.org/manual/5.1/manual.html'
86 globals.set_manual_url 'https://www.lua.org/manual/5.1/manual.html'
7487 end
7588
7689 local file_methods = {