aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/go_list.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 12:47:19 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 12:47:19 -0400
commite239bb3c68a4981a3916534203c2fbd6b96f593c (patch)
treeebb9b1a4a4659d09edaf57ec39a744ff4bc15ff0 /nexgb/xgbgen/go_list.go
parent00c6217ca905b08ce0acda9a90492b5c1dc358e8 (diff)
downloadhaven-e239bb3c68a4981a3916534203c2fbd6b96f593c.tar.gz
haven-e239bb3c68a4981a3916534203c2fbd6b96f593c.tar.xz
haven-e239bb3c68a4981a3916534203c2fbd6b96f593c.zip
make resource ids their own individual types. last commit before overhaul to sub-packages
Diffstat (limited to 'nexgb/xgbgen/go_list.go')
-rw-r--r--nexgb/xgbgen/go_list.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go
index ad859bb..b01519b 100644
--- a/nexgb/xgbgen/go_list.go
+++ b/nexgb/xgbgen/go_list.go
@@ -16,7 +16,8 @@ func (f *ListField) Read(c *Context, prefix string) {
switch t := f.Type.(type) {
case *Resource:
length := f.LengthExpr.Reduce(prefix)
- c.Putln("%s%s = make([]Id, %s)", prefix, f.SrcName(), length)
+ c.Putln("%s%s = make([]%s, %s)",
+ prefix, f.SrcName(), t.SrcName(), length)
c.Putln("for i := 0; i < int(%s); i++ {", length)
ReadSimpleSingleField(c, fmt.Sprintf("%s%s[i]", prefix, f.SrcName()), t)
c.Putln("}")