operator-unset.go: fixed function removal

This commit is contained in:
2024-07-13 09:07:33 +02:00
parent 032916d4fa
commit be3bb12f28
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ func deleteContextItem(ctx ExprContext, opTerm *term, item any) (deleted bool, e
var size int
if strings.HasSuffix(name, "()") {
size = ctx.FuncCount()
ctx.DeleteVar(strings.TrimRight(name, "()"))
ctx.DeleteFunc(strings.TrimRight(name, "()"))
deleted = ctx.FuncCount() < size
} else {
size = ctx.VarCount()