aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/generators/gen_declarations.lua
diff options
context:
space:
mode:
authorSameed Ali <sameedali94@gmail.com>2019-04-14 16:56:11 -0400
committerDaniel Hahler <git@thequod.de>2019-07-04 06:59:44 +0200
commit571b2c5e7be105d23ada987a7c7080f8631bfd15 (patch)
tree0c07e601c2f1e55525f81a5804a5ec992adaeef0 /src/nvim/generators/gen_declarations.lua
parent99b870d61c0a574011d16886d2cea44d18c11a2d (diff)
downloadrneovim-571b2c5e7be105d23ada987a7c7080f8631bfd15.tar.gz
rneovim-571b2c5e7be105d23ada987a7c7080f8631bfd15.tar.bz2
rneovim-571b2c5e7be105d23ada987a7c7080f8631bfd15.zip
Fix luacheck errors for all Lua source files
Diffstat (limited to 'src/nvim/generators/gen_declarations.lua')
-rwxr-xr-xsrc/nvim/generators/gen_declarations.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/generators/gen_declarations.lua b/src/nvim/generators/gen_declarations.lua
index c40c37bb3e..ad44613f42 100755
--- a/src/nvim/generators/gen_declarations.lua
+++ b/src/nvim/generators/gen_declarations.lua
@@ -10,7 +10,7 @@ local lpeg = require('lpeg')
local fold = function (func, ...)
local result = nil
- for i, v in ipairs({...}) do
+ for _, v in ipairs({...}) do
if result == nil then
result = v
else
@@ -107,7 +107,7 @@ local typ_part = concat(
)),
spaces
)
-local typ = one_or_more(typ_part)
+
local typ_id = two_or_more(typ_part)
local arg = typ_id -- argument name is swallowed by typ
local pattern = concat(
@@ -222,7 +222,6 @@ local non_static = header
local static = header
local filepattern = '^#%a* (%d+) "([^"]-)/?([^"/]+)"'
-local curfile
local init = 1
local curfile = nil
@@ -248,14 +247,14 @@ while init ~= nil do
else
declline = declline - 1
end
- elseif init < declendpos then
+ elseif init < declendpos then -- luacheck: ignore 542
-- Skipping over declaration
elseif is_needed_file then
s = init
- e = pattern:match(text, init)
+ local e = pattern:match(text, init)
if e ~= nil then
local declaration = text:sub(s, e - 1)
- -- Comments are really handled by preprocessor, so the following is not
+ -- Comments are really handled by preprocessor, so the following is not
-- needed
declaration = declaration:gsub('/%*.-%*/', '')
declaration = declaration:gsub('//.-\n', '\n')