docgen: generate pragma after generic, fixes #10792 (#10865)

This commit is contained in:
Miran
2019-03-19 12:55:28 +01:00
committed by Andreas Rumpf
parent cd9caf09d1
commit bfc7522401

View File

@@ -1217,8 +1217,14 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
else:
put(g, tkDistinct, "distinct")
of nkTypeDef:
gsub(g, n, 0)
gsub(g, n, 1)
if n.sons[0].kind == nkPragmaExpr:
# generate pragma after generic
gsub(g, n.sons[0], 0)
gsub(g, n, 1)
gsub(g, n.sons[0], 1)
else:
gsub(g, n, 0)
gsub(g, n, 1)
put(g, tkSpaces, Space)
if n.len > 2 and n.sons[2].kind != nkEmpty:
putWithSpace(g, tkEquals, "=")