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
commit bfc7522401

View file

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