genmsgpack: Do not export functions with __

This commit is contained in:
Björn Linse 2017-04-11 23:56:18 +03:00 committed by ZyX
parent 78082e8d3e
commit 7d0fc179e6

View File

@ -127,7 +127,9 @@ local deprecated_aliases = require("api.dispatch_deprecated")
for i,f in ipairs(shallowcopy(functions)) do for i,f in ipairs(shallowcopy(functions)) do
local ismethod = false local ismethod = false
if startswith(f.name, "nvim_") then if startswith(f.name, "nvim_") then
if f.since == nil then if startswith(f.name, "nvim__") then
f.since = -1
elseif f.since == nil then
print("Function "..f.name.." lacks since field.\n") print("Function "..f.name.." lacks since field.\n")
os.exit(1) os.exit(1)
end end
@ -174,11 +176,13 @@ exported_attributes = {'name', 'parameters', 'return_type', 'method',
'since', 'deprecated_since'} 'since', 'deprecated_since'}
exported_functions = {} exported_functions = {}
for _,f in ipairs(functions) do for _,f in ipairs(functions) do
local f_exported = {} if not startswith(f.name, "nvim__") then
for _,attr in ipairs(exported_attributes) do local f_exported = {}
f_exported[attr] = f[attr] for _,attr in ipairs(exported_attributes) do
f_exported[attr] = f[attr]
end
exported_functions[#exported_functions+1] = f_exported
end end
exported_functions[#exported_functions+1] = f_exported
end end