mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
Fix luacheck errors for all Lua source files
This commit is contained in:

committed by
Daniel Hahler

parent
99b870d61c
commit
571b2c5e7b
@@ -1,4 +1,4 @@
|
||||
mpack = require('mpack')
|
||||
local mpack = require('mpack')
|
||||
|
||||
local nvimsrcdir = arg[1]
|
||||
local autodir = arg[2]
|
||||
@@ -10,7 +10,7 @@ if nvimsrcdir == '--help' then
|
||||
Usage:
|
||||
lua geneval.lua src/nvim build/src/nvim/auto
|
||||
|
||||
Will generate build/src/nvim/auto/funcs.generated.h with definition of functions
|
||||
Will generate build/src/nvim/auto/funcs.generated.h with definition of functions
|
||||
static const array.
|
||||
]])
|
||||
os.exit(0)
|
||||
@@ -23,8 +23,8 @@ local funcsfname = autodir .. '/funcs.generated.h'
|
||||
local gperfpipe = io.open(funcsfname .. '.gperf', 'wb')
|
||||
|
||||
local funcs = require('eval').funcs
|
||||
local metadata = mpack.unpack(io.open(arg[3], 'rb'):read("*all"))
|
||||
for i,fun in ipairs(metadata) do
|
||||
local metadata = mpack.unpack(io.open(metadata_file, 'rb'):read("*all"))
|
||||
for _,fun in ipairs(metadata) do
|
||||
if not fun.remote_only then
|
||||
funcs[fun.name] = {
|
||||
args=#fun.parameters,
|
||||
@@ -53,14 +53,14 @@ VimLFuncDef;
|
||||
]])
|
||||
|
||||
for name, def in pairs(funcs) do
|
||||
args = def.args or 0
|
||||
local args = def.args or 0
|
||||
if type(args) == 'number' then
|
||||
args = {args, args}
|
||||
elseif #args == 1 then
|
||||
args[2] = 'MAX_FUNC_ARGS'
|
||||
end
|
||||
func = def.func or ('f_' .. name)
|
||||
data = def.data or "NULL"
|
||||
local func = def.func or ('f_' .. name)
|
||||
local data = def.data or "NULL"
|
||||
gperfpipe:write(('%s, %s, %s, &%s, (FunPtr)%s\n')
|
||||
:format(name, args[1], args[2], func, data))
|
||||
end
|
||||
|
Reference in New Issue
Block a user