Render a colon for command if last arg list (#10803)

This commit is contained in:
Alexander Ivanov
2019-03-08 14:31:24 +02:00
committed by Andreas Rumpf
parent 1a13b3a14e
commit 3294ce3831

View File

@@ -1001,7 +1001,16 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
of nkCommand:
accentedName(g, n[0])
put(g, tkSpaces, Space)
gcomma(g, n, 1)
if n[^1].kind == nkStmtList:
for i, child in n:
if i > 1 and i < n.len - 1:
put(g, tkComma, ",")
elif i == n.len - 1:
put(g, tkColon, ":")
if i > 0:
gsub(g, child)
else:
gcomma(g, n, 1)
of nkExprEqExpr, nkAsgn, nkFastAsgn:
gsub(g, n, 0)
put(g, tkSpaces, Space)