diff options
| author | Daniel Hahler <git@thequod.de> | 2019-07-04 15:21:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-04 15:21:44 +0200 |
| commit | 5835398152b3584b381dcce751b4a53ae634c4d2 (patch) | |
| tree | 327ce2688321a814e8df96fdcce26a5fe72cfaca /src/nvim/generators/gen_declarations.lua | |
| parent | f668f0afb24782aab36c8538f78823598c1f11e3 (diff) | |
| parent | 32361a1245d1584ae074702aa645bc20e353f787 (diff) | |
| download | rneovim-5835398152b3584b381dcce751b4a53ae634c4d2.tar.gz rneovim-5835398152b3584b381dcce751b4a53ae634c4d2.tar.bz2 rneovim-5835398152b3584b381dcce751b4a53ae634c4d2.zip | |
Merge pull request #10414 from blueyed/luacheck
Improve luacheck integration, fix more issues.
Diffstat (limited to 'src/nvim/generators/gen_declarations.lua')
| -rwxr-xr-x | src/nvim/generators/gen_declarations.lua | 11 |
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') |