From f63229c6f8e9e8dfb7667561fc8118f2c00bc304 Mon Sep 17 00:00:00 2001 From: William Bell Date: Thu, 22 Jun 2023 23:59:20 +0100 Subject: [PATCH] fix check if value is in array --- src/array.go | 2 +- src/operations.go | 2 +- src/string.go | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/array.go b/src/array.go index 5e1bf92..e8b9697 100644 --- a/src/array.go +++ b/src/array.go @@ -583,7 +583,7 @@ func ArArray(arr []any) ArObject { } for _, v := range arr { res, err := runOperation(operationType{ - operation: 8, + operation: 9, value1: v, value2: args[0], }, stack{}, 0) diff --git a/src/operations.go b/src/operations.go index fca3477..a8aee27 100644 --- a/src/operations.go +++ b/src/operations.go @@ -806,7 +806,7 @@ func equals(a any, b any, o operationType, stack stack, stacklevel int) (bool, A } } if x, ok := b.(ArObject); ok { - if y, ok := x.obj["__GreaterThanEqual__"]; ok { + if y, ok := x.obj["__Equal__"]; ok { val, err := runCall( call{ y, diff --git a/src/string.go b/src/string.go index e8c1691..700181f 100644 --- a/src/string.go +++ b/src/string.go @@ -553,7 +553,6 @@ func ArString(str string) ArObject { return nil, ArErr{"TypeError", "expected 1 argument, got " + fmt.Sprint(len(a)), 0, "", "", true} } a[0] = ArValidToAny(a[0]) - fmt.Println(str, a[0]) return str != a[0], ArErr{} }} obj.obj["__Add__"] = builtinFunc{