q/src/ssa/Parameter.go
Eduard Urbach ca9595d1fb
All checks were successful
/ test (push) Successful in 15s
Simplified ssa package
2025-07-03 22:54:30 +02:00

30 lines
No EOL
540 B
Go

package ssa
import (
"fmt"
"git.urbach.dev/cli/q/src/types"
)
type Parameter struct {
Index uint8
Name string
Typ types.Type
Liveness
Source
}
func (v *Parameter) Inputs() []Value { return nil }
func (v *Parameter) IsConst() bool { return true }
func (v *Parameter) String() string { return fmt.Sprintf("args[%d]", v.Index) }
func (v *Parameter) Type() types.Type { return v.Typ }
func (a *Parameter) Equals(v Value) bool {
b, sameType := v.(*Parameter)
if !sameType {
return false
}
return a.Index == b.Index
}