Skip to content

Commit 8f94bf9

Browse files
committed
cleanup
1 parent 281ba5f commit 8f94bf9

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

script/parser/luadoc.lua

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ local function parseTable(parent)
291291
needCloseParen = true
292292
end
293293
field.name = parseName('doc.field.name', field)
294-
or parseIndexField(field)
294+
or parseIndexField(field)
295295
if not field.name then
296296
pushWarning {
297297
type = 'LUADOC_MISS_FIELD_NAME',
@@ -401,7 +401,7 @@ local function parseTypeUnitFunction(parent)
401401
parent = typeUnit,
402402
}
403403
arg.name = parseName('doc.type.arg.name', arg)
404-
or parseDots('doc.type.arg.name', arg)
404+
or parseDots('doc.type.arg.name', arg)
405405
if not arg.name then
406406
pushWarning {
407407
type = 'LUADOC_MISS_ARG_NAME',
@@ -442,7 +442,7 @@ local function parseTypeUnitFunction(parent)
442442
local name
443443
try(function ()
444444
local returnName = parseName('doc.return.name', typeUnit)
445-
or parseDots('doc.return.name', typeUnit)
445+
or parseDots('doc.return.name', typeUnit)
446446
if not returnName then
447447
return false
448448
end
@@ -646,15 +646,15 @@ end
646646

647647
function parseTypeUnit(parent)
648648
local result = parseFunction(parent)
649-
or parseTable(parent)
650-
or parseString(parent)
651-
or parseCode(parent)
652-
or parseInteger(parent)
653-
or parseBoolean(parent)
654-
or parseParen(parent)
649+
or parseTable(parent)
650+
or parseString(parent)
651+
or parseCode(parent)
652+
or parseInteger(parent)
653+
or parseBoolean(parent)
654+
or parseParen(parent)
655655
if not result then
656656
result = parseName('doc.type.name', parent)
657-
or parseDots('doc.type.name', parent)
657+
or parseDots('doc.type.name', parent)
658658
if not result then
659659
return nil
660660
end
@@ -827,7 +827,7 @@ local docSwitch = util.switch()
827827

828828
while true do
829829
local extend = parseName('doc.extends.name', result)
830-
or parseTable(result)
830+
or parseTable(result)
831831
if not extend then
832832
pushWarning {
833833
type = 'LUADOC_MISS_CLASS_EXTENDS_NAME',
@@ -896,7 +896,7 @@ local docSwitch = util.switch()
896896
type = 'doc.param',
897897
}
898898
result.param = parseName('doc.param.name', result)
899-
or parseDots('doc.param.name', result)
899+
or parseDots('doc.param.name', result)
900900
if not result.param then
901901
pushWarning {
902902
type = 'LUADOC_MISS_PARAM_NAME',
@@ -951,7 +951,7 @@ local docSwitch = util.switch()
951951
dots.parent = docType
952952
else
953953
docType.name = parseName('doc.return.name', docType)
954-
or parseDots('doc.return.name', docType)
954+
or parseDots('doc.return.name', docType)
955955
end
956956
result.returns[#result.returns+1] = docType
957957
if not checkToken('symbol', ',', 1) then
@@ -990,7 +990,7 @@ local docSwitch = util.switch()
990990
return false
991991
end)
992992
result.field = parseName('doc.field.name', result)
993-
or parseIndexField(result)
993+
or parseIndexField(result)
994994
if not result.field then
995995
pushWarning {
996996
type = 'LUADOC_MISS_FIELD_NAME',
@@ -1514,7 +1514,7 @@ end
15141514
local function buildLuaDoc(comment)
15151515
local text = comment.text
15161516
local startPos = (comment.type == 'comment.short' and text:match '^%-%s*@()')
1517-
or (comment.type == 'comment.long' and text:match '^@()')
1517+
or (comment.type == 'comment.long' and text:match '^@()')
15181518
if not startPos then
15191519
return {
15201520
type = 'doc.comment',
@@ -1983,8 +1983,8 @@ local function findTouch(state, doc)
19831983
local pos = guide.positionToOffset(state, doc.originalComment.start)
19841984
for i = pos - 2, 1, -1 do
19851985
local c = text:sub(i, i)
1986-
if c == '\r'
1987-
or c == '\n' then
1986+
if c == '\r'
1987+
or c == '\n' then
19881988
break
19891989
elseif c ~= ' '
19901990
and c ~= '\t' then
@@ -2013,7 +2013,7 @@ return {
20132013
table.sort(comments, function (a, b)
20142014
return a.start < b.start
20152015
end)
2016-
ast.docs = ast.docs or {
2016+
ast.docs = {
20172017
type = 'doc',
20182018
parent = ast,
20192019
groups = {},
@@ -2095,4 +2095,4 @@ return {
20952095

20962096
bindDocs(state)
20972097
end
2098-
}
2098+
}

0 commit comments

Comments
 (0)