diff --git a/compiler/docgen.nim b/compiler/docgen.nim index 739f0dbddfc90..0a168b5046463 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -805,9 +805,7 @@ proc getAllRunnableExamples(d: PDoc, n: PNode, dest: var ItemPre) = proc isVisible(d: PDoc; n: PNode): bool = result = false if n.kind == nkPostfix: - if n.len == 2 and n[0].kind == nkIdent: - var v = n[0].ident - result = v.id == ord(wStar) or v.id == ord(wMinus) + result = isVisible(d, n[1]) elif n.kind == nkSym: # we cannot generate code for forwarded symbols here as we have no # exception tracking information here. Instead we copy over the comment diff --git a/compiler/renderer.nim b/compiler/renderer.nim index c9d527fd6ee3c..7c0af80f43dcb 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -86,7 +86,7 @@ proc isExported(n: PNode): bool = ## This is meant to be used with idents in nkIdentDefs. case n.kind of nkPostfix: - n[0].ident.s == "*" and n[1].kind == nkIdent + true of nkPragmaExpr: n[0].isExported() else: false @@ -1429,7 +1429,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext, fromStmtList = false) = let s = n[1].sym var ret = renderDefinitionName(s) ret.genSymSuffix(s) - put(g, tkSymbol, ret) + put(g, tkSymbol, ret, if renderSyms in g.flags: s else: nil) else: gsub(g, n, 1) if renderNoPostfix notin g.flags: