@@ -291,7 +291,7 @@ local function parseTable(parent)
291
291
needCloseParen = true
292
292
end
293
293
field .name = parseName (' doc.field.name' , field )
294
- or parseIndexField (field )
294
+ or parseIndexField (field )
295
295
if not field .name then
296
296
pushWarning {
297
297
type = ' LUADOC_MISS_FIELD_NAME' ,
@@ -401,7 +401,7 @@ local function parseTypeUnitFunction(parent)
401
401
parent = typeUnit ,
402
402
}
403
403
arg .name = parseName (' doc.type.arg.name' , arg )
404
- or parseDots (' doc.type.arg.name' , arg )
404
+ or parseDots (' doc.type.arg.name' , arg )
405
405
if not arg .name then
406
406
pushWarning {
407
407
type = ' LUADOC_MISS_ARG_NAME' ,
@@ -442,7 +442,7 @@ local function parseTypeUnitFunction(parent)
442
442
local name
443
443
try (function ()
444
444
local returnName = parseName (' doc.return.name' , typeUnit )
445
- or parseDots (' doc.return.name' , typeUnit )
445
+ or parseDots (' doc.return.name' , typeUnit )
446
446
if not returnName then
447
447
return false
448
448
end
@@ -646,15 +646,15 @@ end
646
646
647
647
function parseTypeUnit (parent )
648
648
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 )
655
655
if not result then
656
656
result = parseName (' doc.type.name' , parent )
657
- or parseDots (' doc.type.name' , parent )
657
+ or parseDots (' doc.type.name' , parent )
658
658
if not result then
659
659
return nil
660
660
end
@@ -827,7 +827,7 @@ local docSwitch = util.switch()
827
827
828
828
while true do
829
829
local extend = parseName (' doc.extends.name' , result )
830
- or parseTable (result )
830
+ or parseTable (result )
831
831
if not extend then
832
832
pushWarning {
833
833
type = ' LUADOC_MISS_CLASS_EXTENDS_NAME' ,
@@ -896,7 +896,7 @@ local docSwitch = util.switch()
896
896
type = ' doc.param' ,
897
897
}
898
898
result .param = parseName (' doc.param.name' , result )
899
- or parseDots (' doc.param.name' , result )
899
+ or parseDots (' doc.param.name' , result )
900
900
if not result .param then
901
901
pushWarning {
902
902
type = ' LUADOC_MISS_PARAM_NAME' ,
@@ -951,7 +951,7 @@ local docSwitch = util.switch()
951
951
dots .parent = docType
952
952
else
953
953
docType .name = parseName (' doc.return.name' , docType )
954
- or parseDots (' doc.return.name' , docType )
954
+ or parseDots (' doc.return.name' , docType )
955
955
end
956
956
result .returns [# result .returns + 1 ] = docType
957
957
if not checkToken (' symbol' , ' ,' , 1 ) then
@@ -990,7 +990,7 @@ local docSwitch = util.switch()
990
990
return false
991
991
end )
992
992
result .field = parseName (' doc.field.name' , result )
993
- or parseIndexField (result )
993
+ or parseIndexField (result )
994
994
if not result .field then
995
995
pushWarning {
996
996
type = ' LUADOC_MISS_FIELD_NAME' ,
@@ -1514,7 +1514,7 @@ end
1514
1514
local function buildLuaDoc (comment )
1515
1515
local text = comment .text
1516
1516
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 ' ^@()' )
1518
1518
if not startPos then
1519
1519
return {
1520
1520
type = ' doc.comment' ,
@@ -1983,8 +1983,8 @@ local function findTouch(state, doc)
1983
1983
local pos = guide .positionToOffset (state , doc .originalComment .start )
1984
1984
for i = pos - 2 , 1 , - 1 do
1985
1985
local c = text :sub (i , i )
1986
- if c == ' \r '
1987
- or c == ' \n ' then
1986
+ if c == ' \r '
1987
+ or c == ' \n ' then
1988
1988
break
1989
1989
elseif c ~= ' '
1990
1990
and c ~= ' \t ' then
@@ -2013,7 +2013,7 @@ return {
2013
2013
table.sort (comments , function (a , b )
2014
2014
return a .start < b .start
2015
2015
end )
2016
- ast .docs = ast . docs or {
2016
+ ast .docs = {
2017
2017
type = ' doc' ,
2018
2018
parent = ast ,
2019
2019
groups = {},
@@ -2095,4 +2095,4 @@ return {
2095
2095
2096
2096
bindDocs (state )
2097
2097
end
2098
- }
2098
+ }
0 commit comments