Removed duplicate debug code
All checks were successful
/ test (push) Successful in 17s

This commit is contained in:
Eduard Urbach 2025-07-03 16:46:56 +02:00
parent bdb1b9595f
commit 4aa4d613a1
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
12 changed files with 58 additions and 85 deletions

View file

@ -38,7 +38,7 @@ func (v *Return) IsConst() bool {
return false
}
func (v *Return) Debug() string {
func (v *Return) Debug(expand bool) string {
if len(v.Arguments) == 0 {
return "return"
}
@ -47,8 +47,12 @@ func (v *Return) Debug() string {
tmp.WriteString("return ")
for i, arg := range v.Arguments {
tmp.WriteString("%")
tmp.WriteString(strconv.Itoa(arg.ID()))
if expand {
tmp.WriteString(arg.String())
} else {
tmp.WriteString("%")
tmp.WriteString(strconv.Itoa(arg.ID()))
}
if i != len(v.Arguments)-1 {
tmp.WriteString(", ")
@ -59,22 +63,7 @@ func (v *Return) Debug() string {
}
func (v *Return) String() string {
if len(v.Arguments) == 0 {
return "return"
}
tmp := strings.Builder{}
tmp.WriteString("return ")
for i, arg := range v.Arguments {
tmp.WriteString(arg.String())
if i != len(v.Arguments)-1 {
tmp.WriteString(", ")
}
}
return tmp.String()
return v.Debug(true)
}
func (v *Return) Type() types.Type {