Example #1
0
File: job.go Project: cznic/c
func (j *Job) union(n cc.Node, t cc.Type) {
	j.body("\n_ [0]struct{")
	m, _ := t.Members()
	for _, v := range m {
		j.body("\n%s", xc.Dict.S(v.Name))
		j.typ(n, v.Type)
		if t := v.Type; t.Kind() != cc.Union && t.Kind() != cc.Struct {
			j.body(" // %s", v.Type)
		}
	}
	j.body("\n}")
	j.body("\nUnion [%v]byte", t.SizeOf())
}