aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/generators/gen_eval.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-07-28 14:48:41 +0100
committerGitHub <noreply@github.com>2023-07-28 14:48:41 +0100
commit42333ea98dfcd2994ee128a3467dfe68205154cd (patch)
tree79df4cf00f96ce5d9c549c12533253722e200461 /src/nvim/generators/gen_eval.lua
parentc1c2a1b5dd1d73e5e97b94e6626aaac25a3db9bc (diff)
downloadrneovim-42333ea98dfcd2994ee128a3467dfe68205154cd.tar.gz
rneovim-42333ea98dfcd2994ee128a3467dfe68205154cd.tar.bz2
rneovim-42333ea98dfcd2994ee128a3467dfe68205154cd.zip
feat(docs): generate builtin.txt (#24493)
- eval.lua is now the source of truth. - Formatting is much more consistent. - Fixed Lua type generation for polymorphic functions (get(), etc). - Removed "Overview" section from builtin.txt - Can generate this if we really want it. - Moved functions from sign.txt and testing.txt into builtin.txt. - Removed the *timer* *timers* tags since libuv timers via vim.uv should be preferred. - Removed the temp-file-name tag from tempname() - Moved lueval() from lua.txt to builtin.txt. * Fix indent * fixup! * fixup! fixup! * fixup! better tag formatting * fixup: revert changes no longer needed * fixup! CI --------- Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src/nvim/generators/gen_eval.lua')
-rw-r--r--src/nvim/generators/gen_eval.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/generators/gen_eval.lua b/src/nvim/generators/gen_eval.lua
index 6858fbc917..c7978f0d19 100644
--- a/src/nvim/generators/gen_eval.lua
+++ b/src/nvim/generators/gen_eval.lua
@@ -10,7 +10,7 @@ local funcsfname = autodir .. '/funcs.generated.h'
local hashy = require'generators.hashy'
-local hashpipe = io.open(funcsfname, 'wb')
+local hashpipe = assert(io.open(funcsfname, 'wb'))
hashpipe:write([[
#include "nvim/arglist.h"
@@ -62,16 +62,22 @@ for _,fun in ipairs(metadata) do
end
end
-local func_names = vim.tbl_keys(funcs)
+local func_names = vim.tbl_filter(function(name)
+ return name:match('__%d*$') == nil
+end, vim.tbl_keys(funcs))
+
table.sort(func_names)
-local funcsdata = io.open(funcs_file, 'w')
+
+local funcsdata = assert(io.open(funcs_file, 'w'))
funcsdata:write(mpack.encode(func_names))
funcsdata:close()
local neworder, hashfun = hashy.hashy_hash("find_internal_func", func_names, function (idx)
return "functions["..idx.."].name"
end)
+
hashpipe:write("static const EvalFuncDef functions[] = {\n")
+
for _, name in ipairs(neworder) do
local def = funcs[name]
local args = def.args or 0