Added --docInternal option to allow 'nim doc' to include non-exported symbols

This commit is contained in:
Ico Doornekamp 2019-01-21 22:56:40 +01:00 • committed by Andreas Rumpf
commit 7fcf51248b
4 changed files with 8 additions and 1 deletions

View file

@ -464,7 +464,10 @@ proc isVisible(d: PDoc; n: PNode): bool =
# we cannot generate code for forwarded symbols here as we have no
# exception tracking information here. Instead we copy over the comment
# from the proc header.
result = {sfExported, sfFromGeneric, sfForward}*n.sym.flags == {sfExported}
if optDocInternal in d.conf.globalOptions:
result = {sfFromGeneric, sfForward}*n.sym.flags == {}
else:
result = {sfExported, sfFromGeneric, sfForward}*n.sym.flags == {sfExported}
if result and containsOrIncl(d.emitted, n.sym.id):
result = false
elif n.kind == nkPragmaExpr: