fix #15702, show enum fields documentation (#15792)

This commit is contained in:
Miran 2020-10-30 16:30:00 +01:00 • committed by GitHub
commit 28bbcd9d45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 2 deletions

View file

@ -133,7 +133,8 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType =
e.typ = result
e.position = int(counter)
let symNode = newSymNode(e)
if optNimV1Emulation notin c.config.globalOptions and identToReplace != nil:
if optNimV1Emulation notin c.config.globalOptions and identToReplace != nil and
c.config.cmd != cmdDoc: # A hack to produce documentation for enum fields.
identToReplace[] = symNode
if e.position == 0: hasNull = true
if result.sym != nil and sfExported in result.sym.flags: