unions, events and errors... oh my

This commit is contained in:
Andrew Gallant (Ocelot)
2012-05-01 01:08:03 -04:00
parent 73154769b3
commit 83a71d4648
8 changed files with 317 additions and 38 deletions

View File

@@ -191,7 +191,7 @@ func (e *Event) XmlName() string {
}
func (e *Event) Size() Size {
panic("Cannot take size of Event type.")
return newExpressionSize(&Value{v: 32})
}
func (e *Event) Initialize(p *Protocol) {
@@ -358,7 +358,7 @@ func (u *Union) Size() Size {
}
func (u *Union) Initialize(p *Protocol) {
u.srcName = TypeSrcName(p, u)
u.srcName = fmt.Sprintf("%sUnion", TypeSrcName(p, u))
for _, field := range u.Fields {
field.Initialize(p)
}