fixes #1799
This commit is contained in:
parent
1c9f05ef13
commit
5206c310e6
2 changed files with 4 additions and 3 deletions
|
|
@ -158,7 +158,7 @@ proc genRecComment(d: PDoc, n: PNode): Rope =
|
||||||
if n == nil: return nil
|
if n == nil: return nil
|
||||||
result = genComment(d, n).rope
|
result = genComment(d, n).rope
|
||||||
if result == nil:
|
if result == nil:
|
||||||
if n.kind notin {nkEmpty..nkNilLit}:
|
if n.kind notin {nkEmpty..nkNilLit, nkEnumTy}:
|
||||||
for i in countup(0, len(n)-1):
|
for i in countup(0, len(n)-1):
|
||||||
result = genRecComment(d, n.sons[i])
|
result = genRecComment(d, n.sons[i])
|
||||||
if result != nil: return
|
if result != nil: return
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ proc rawSkipComment(p: var TParser, node: PNode) =
|
||||||
getTok(p)
|
getTok(p)
|
||||||
|
|
||||||
proc skipComment(p: var TParser, node: PNode) =
|
proc skipComment(p: var TParser, node: PNode) =
|
||||||
if p.tok.indent < 0: rawSkipComment(p, node)
|
if p.tok.indent < 0 or realInd(p): rawSkipComment(p, node)
|
||||||
|
|
||||||
proc skipInd(p: var TParser) =
|
proc skipInd(p: var TParser) =
|
||||||
if p.tok.indent >= 0:
|
if p.tok.indent >= 0:
|
||||||
|
|
@ -887,7 +887,7 @@ proc parseTuple(p: var TParser, indentAllowed = false): PNode =
|
||||||
skipComment(p, result)
|
skipComment(p, result)
|
||||||
if realInd(p):
|
if realInd(p):
|
||||||
withInd(p):
|
withInd(p):
|
||||||
skipComment(p, result)
|
rawSkipComment(p, result)
|
||||||
while true:
|
while true:
|
||||||
case p.tok.tokType
|
case p.tok.tokType
|
||||||
of tkSymbol, tkAccent:
|
of tkSymbol, tkAccent:
|
||||||
|
|
@ -1608,6 +1608,7 @@ proc parseEnum(p: var TParser): PNode =
|
||||||
getTok(p)
|
getTok(p)
|
||||||
addSon(result, ast.emptyNode)
|
addSon(result, ast.emptyNode)
|
||||||
optInd(p, result)
|
optInd(p, result)
|
||||||
|
rawSkipComment(p, result)
|
||||||
while true:
|
while true:
|
||||||
var a = parseSymbol(p)
|
var a = parseSymbol(p)
|
||||||
if a.kind == nkEmpty: return
|
if a.kind == nkEmpty: return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue