Render a colon for command if last arg list (#10803)
This commit is contained in:
parent
1a13b3a14e
commit
3294ce3831
1 changed files with 10 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue