mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-03 12:34:44 +00:00
Render a colon for command if last arg list (#10803)
This commit is contained in:
committed by
Andreas Rumpf
parent
1a13b3a14e
commit
3294ce3831
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user