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.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253package ssa
import ( "fmt" "strings")
// Arguments defines a list of values that this value depends on.type Arguments []Value
// Equals returns true if all the arguments are equal.func (a Arguments) Equals(b Arguments) bool { if len(a) != len(b) { return false }
for i := range a { if a[i] != b[i] { return false } }
return true}
// Inputs is the arguments list itself.func (v Arguments) Inputs() []Value { return v}
// Replace replaces the `old` value with `new`.func (v Arguments) Replace(old Value, new Value) { for i, arg := range v { if arg == old { v[i] = new } }}
// String returns a comma-separated list of all arguments.func (v Arguments) String() string { tmp := strings.Builder{}
for i, arg := range v { tmp.WriteString(fmt.Sprintf("%p", arg))
if i != len(v)-1 { tmp.WriteString(", ") } }
return tmp.String()}