bugfix: code gen for constant sequences
This commit is contained in:
parent
93be594eca
commit
64e74cf484
1 changed files with 7 additions and 2 deletions
|
|
@ -1874,8 +1874,13 @@ proc genConstSimpleList(p: BProc, n: PNode): PRope =
|
||||||
|
|
||||||
proc genConstSeq(p: BProc, n: PNode, t: PType): PRope =
|
proc genConstSeq(p: BProc, n: PNode, t: PType): PRope =
|
||||||
var data = ropef("{{$1, $1}", n.len.toRope)
|
var data = ropef("{{$1, $1}", n.len.toRope)
|
||||||
for i in countup(0, n.len - 1):
|
if n.len > 0:
|
||||||
appf(data, ",$1$n", [genConstExpr(p, n.sons[i])])
|
# array part needs extra curlies:
|
||||||
|
data.app(", {")
|
||||||
|
for i in countup(0, n.len - 1):
|
||||||
|
if i > 0: data.appf(",$n")
|
||||||
|
data.app genConstExpr(p, n.sons[i])
|
||||||
|
data.app("}")
|
||||||
data.app("}")
|
data.app("}")
|
||||||
|
|
||||||
inc(gBackendId)
|
inc(gBackendId)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue