Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
high-performance programming-language compiler
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536package types
import "strings"
// Tuple is a collection of multiple types.type Tuple struct { Types []Type}
// Name returns the type name.func (t *Tuple) Name() string { b := strings.Builder{} b.WriteString("(")
for i, typ := range t.Types { b.WriteString(typ.Name())
if i != len(t.Types)-1 { b.WriteString(", ") } }
b.WriteString(")") return b.String()}
// Size returns the total size in bytes.func (t *Tuple) Size() int { sum := 0
for _, typ := range t.Types { sum += typ.Size() }
return sum}