This commit is contained in:
Araq 2014-12-19 12:53:51 +01:00
commit 18cbd51600
3 changed files with 10 additions and 9 deletions

View file

@ -947,10 +947,10 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
of nkConstDef, nkIdentDefs:
gcomma(g, n, 0, -3)
var L = sonsLen(n)
if n.sons[L - 2].kind != nkEmpty:
if L >= 2 and n.sons[L - 2].kind != nkEmpty:
putWithSpace(g, tkColon, ":")
gsub(g, n.sons[L - 2])
if n.sons[L - 1].kind != nkEmpty:
if L >= 1 and n.sons[L - 1].kind != nkEmpty:
put(g, tkSpaces, Space)
putWithSpace(g, tkEquals, "=")
gsub(g, n.sons[L - 1], c)