make rst.nim use object variant (#17138)

* make rst.nim use object variant

* add workaround

* fix mistake
This commit is contained in:
Andrey Makarov 2021-02-22 13:00:31 +03:00 • committed by GitHub
commit fab1618eb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 159 additions and 132 deletions

View file

@ -677,8 +677,8 @@ proc getRstName(n: PNode): PRstNode =
case n.kind
of nkPostfix: result = getRstName(n[1])
of nkPragmaExpr: result = getRstName(n[0])
of nkSym: result = newRstNode(rnLeaf, n.sym.renderDefinitionName)
of nkIdent: result = newRstNode(rnLeaf, n.ident.s)
of nkSym: result = newRstLeaf(n.sym.renderDefinitionName)
of nkIdent: result = newRstLeaf(n.ident.s)
of nkAccQuoted:
result = getRstName(n[0])
for i in 1..<n.len: result.text.add(getRstName(n[i]).text)