Merge pull request #236 from catwell/pull-1
Support Lua 5.3
Steve J Donovan authored 7 years ago
GitHub committed 7 years ago
2 | 2 | local tools = require 'ldoc.tools' |
3 | 3 | local globals = {} |
4 | 4 | local lua52 = _VERSION:match '5.2' |
5 | local lua53 = _VERSION:match '5.3' | |
5 | 6 | |
6 | 7 | |
7 | 8 | globals.functions = { |
32 | 33 | } |
33 | 34 | local functions = globals.functions |
34 | 35 | |
35 | if not lua52 then | |
36 | if lua52 or lua53 then | |
37 | functions.rawlen = true | |
38 | else | |
36 | 39 | functions.setfenv = true |
37 | 40 | functions.getfenv = true |
38 | 41 | functions.unpack = true |
39 | else | |
40 | functions.rawlen = true | |
41 | 42 | end |
42 | 43 | |
43 | 44 | local manual, fun_ref |
47 | 48 | fun_ref = manual..'pdf-' |
48 | 49 | end |
49 | 50 | |
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 | |
51 | 64 | globals.tables = { |
52 | 65 | io = '6.8', |
53 | 66 | package = '6.3', |
58 | 71 | coroutine = '6.2', |
59 | 72 | debug = '6.10' |
60 | 73 | } |
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' | |
62 | 75 | else |
63 | 76 | globals.tables = { |
64 | 77 | io = '5.7', |
70 | 83 | coroutine = '5.2', |
71 | 84 | debug = '5.9' |
72 | 85 | } |
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' | |
74 | 87 | end |
75 | 88 | |
76 | 89 | local file_methods = { |