aboutsummaryrefslogtreecommitdiff
path: root/src/gen/gen_api_dispatch.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/gen/gen_api_dispatch.lua')
-rw-r--r--src/gen/gen_api_dispatch.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gen/gen_api_dispatch.lua b/src/gen/gen_api_dispatch.lua
index b5433527bc..6480e66489 100644
--- a/src/gen/gen_api_dispatch.lua
+++ b/src/gen/gen_api_dispatch.lua
@@ -11,8 +11,6 @@ local mpack = vim.mpack
local hashy = require 'gen.hashy'
-local pre_args = 7
-assert(#arg >= pre_args)
-- output h file with generated dispatch functions (dispatch_wrappers.generated.h)
local dispatch_outputf = arg[1]
-- output h file with packed metadata (api_metadata.generated.h)
@@ -23,6 +21,11 @@ local lua_c_bindings_outputf = arg[4] -- lua_api_c_bindings.generated.c
local keysets_outputf = arg[5] -- keysets_defs.generated.h
local ui_metadata_inputf = arg[6] -- ui events metadata
local git_version_inputf = arg[7] -- git version header
+local nvim_version_inputf = arg[8] -- nvim version
+local dump_bin_array_inputf = arg[9]
+local dispatch_deprecated_inputf = arg[10]
+local pre_args = 10
+assert(#arg >= pre_args)
local functions = {}
@@ -152,7 +155,7 @@ end
-- Export functions under older deprecated names.
-- These will be removed eventually.
-local deprecated_aliases = require('nvim.api.dispatch_deprecated')
+local deprecated_aliases = loadfile(dispatch_deprecated_inputf)()
for _, f in ipairs(shallowcopy(functions)) do
local ismethod = false
if startswith(f.name, 'nvim_') then
@@ -244,7 +247,7 @@ for x in string.gmatch(ui_options_text, '"([a-z][a-z_]+)"') do
table.insert(ui_options, x)
end
-local version = require 'nvim_version' -- `build/nvim_version.lua` file.
+local version = loadfile(nvim_version_inputf)()
local git_version = io.open(git_version_inputf):read '*a'
local version_build = string.match(git_version, '#define NVIM_VERSION_BUILD "([^"]+)"') or vim.NIL
@@ -302,7 +305,7 @@ for i, item in ipairs(types) do
end
local packed = table.concat(pieces)
-local dump_bin_array = require('gen.dump_bin_array')
+local dump_bin_array = loadfile(dump_bin_array_inputf)()
dump_bin_array(api_metadata_output, 'packed_api_metadata', packed)
api_metadata_output:close()