workaround for Lua file methods #157
Steve Donovan
10 years ago
72 | 72 | globals.set_manual_url 'http://www.lua.org/manual/5.1/manual.html' |
73 | 73 | end |
74 | 74 | |
75 | local file_methods = { | |
76 | close = true, | |
77 | flush = true, | |
78 | lines = true, | |
79 | read = true, | |
80 | seek = true, | |
81 | setvbuf = true, | |
82 | write = true, | |
83 | } | |
84 | ||
75 | 85 | -- external libs tracked by LDoc using LDoc style |
76 | 86 | local xlibs = { |
77 | 87 | lfs='lfs.html', lpeg='lpeg.html', |
89 | 99 | return nil |
90 | 100 | end |
91 | 101 | end |
92 | if tables[tbl] then -- function inside standard Lua table | |
102 | if tbl == 'file' then -- special case: file objects! | |
103 | if not file_methods[name] then | |
104 | return nil | |
105 | end | |
106 | name = 'file:'..name | |
107 | href = fun_ref..name | |
108 | elseif tables[tbl] then -- function inside standard Lua table | |
93 | 109 | local t = rawget(_G,tbl) -- do a quick sanity check |
94 | 110 | if not rawget(t,name) then |
95 | 111 | return nil |