aboutsummaryrefslogtreecommitdiff
path: root/modules/lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2015-03-16 16:55:12 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2015-03-16 16:55:12 -0400
commit39b5f8728fdd215217d2749c20a2668ecbb5f080 (patch)
tree603e845b6683f6725593c8f12e69183156b6c5c2 /modules/lua
parentcb3e886bba78a040d486af518d491cc191cebfd8 (diff)
downloadtextadept-39b5f8728fdd215217d2749c20a2668ecbb5f080.tar.gz
textadept-39b5f8728fdd215217d2749c20a2668ecbb5f080.zip
Code cleanup based on the output of luacheck, a Lua linter.
Diffstat (limited to 'modules/lua')
-rw-r--r--modules/lua/init.lua6
-rw-r--r--modules/lua/tadoc.lua22
2 files changed, 14 insertions, 14 deletions
diff --git a/modules/lua/init.lua b/modules/lua/init.lua
index a735c544..f2ae7343 100644
--- a/modules/lua/init.lua
+++ b/modules/lua/init.lua
@@ -58,10 +58,10 @@ textadept.editing.autocompleters.lua = function()
local sep = string.char(buffer.auto_c_type_separator)
for i = 1, #M.tags do
if lfs.attributes(M.tags[i]) then
- for line in io.lines(M.tags[i]) do
- local name = line:match('^%S+')
+ for tag_line in io.lines(M.tags[i]) do
+ local name = tag_line:match('^%S+')
if name:find(name_patt) and not list[name] then
- local fields = line:match(';"\t(.*)$')
+ local fields = tag_line:match(';"\t(.*)$')
local k, class = fields:sub(1, 1), fields:match('class:(%S+)') or ''
if class == symbol and (op ~= ':' or k == 'f') then
list[#list + 1] = ("%s%s%d"):format(name, sep, xpms[k])
diff --git a/modules/lua/tadoc.lua b/modules/lua/tadoc.lua
index 3c6f381f..b097e892 100644
--- a/modules/lua/tadoc.lua
+++ b/modules/lua/tadoc.lua
@@ -176,16 +176,16 @@ function M.start(doc)
write_apidoc(apidoc, {name = '_G'}, m)
end
-- Tag and document the functions.
- for i = 1, #m.functions do
- local module_name, name = m.functions[i]:match('^(.-)[%.:]?([^.:]+)$')
+ for j = 1, #m.functions do
+ local module_name, name = m.functions[j]:match('^(.-)[%.:]?([^.:]+)$')
if module_name == '' then module_name = m.name end
write_tag(ctags, name, 'f', 'class:'..module_name)
- write_apidoc(apidoc, m, m.functions[m.functions[i]])
+ write_apidoc(apidoc, m, m.functions[m.functions[j]])
end
if m.tables then
-- Document the tables.
- for i = 1, #m.tables do
- local table_name, table = m.tables[i], m.tables[m.tables[i]]
+ for j = 1, #m.tables do
+ local table_name, table = m.tables[j], m.tables[m.tables[j]]
local module_name = m.name
if table_name:find('^_G%.') then
module_name, table_name = table_name:match('^_G%.(.-)%.?([^%.]+)$')
@@ -200,11 +200,11 @@ function M.start(doc)
if table.field then
-- Tag and document the table's fields.
table_name = module_name..'.'..table_name
- for j = 1, #table.field do
- write_tag(ctags, table.field[j], 'F', 'class:'..table_name)
+ for k = 1, #table.field do
+ write_tag(ctags, table.field[k], 'F', 'class:'..table_name)
write_apidoc(apidoc, {name = table_name}, {
- name = table.field[j],
- description = table.field[table.field[j]],
+ name = table.field[k],
+ description = table.field[table.field[k]],
class = 'table'
})
end
@@ -213,8 +213,8 @@ function M.start(doc)
end
if m.fields then
-- Tag and document the fields.
- for i = 1, #m.fields do
- local field_name, field = m.fields[i], m.fields[m.fields[i]]
+ for j = 1, #m.fields do
+ local field_name, field = m.fields[j], m.fields[m.fields[j]]
local module_name = m.name
if field_name:find('^_G%.') then
module_name, field_name = field_name:match('^_G%.(.-)%.?([^%.]+)$')