From 23d8742f0d95096b92f11729fb47f86ac3b68d43 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 18 Jul 2020 17:27:41 +0200 Subject: Update dependencies for 1.18.0 release (#1175) --- vendor/github.com/d5/tengo/v2/objects.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'vendor/github.com/d5/tengo/v2/objects.go') diff --git a/vendor/github.com/d5/tengo/v2/objects.go b/vendor/github.com/d5/tengo/v2/objects.go index 27c1d493..30913db5 100644 --- a/vendor/github.com/d5/tengo/v2/objects.go +++ b/vendor/github.com/d5/tengo/v2/objects.go @@ -1342,6 +1342,38 @@ func (o *String) BinaryOp(op token.Token, rhs Object) (Object, error) { } return &String{Value: o.Value + rhsStr}, nil } + case token.Less: + switch rhs := rhs.(type) { + case *String: + if o.Value < rhs.Value { + return TrueValue, nil + } + return FalseValue, nil + } + case token.LessEq: + switch rhs := rhs.(type) { + case *String: + if o.Value <= rhs.Value { + return TrueValue, nil + } + return FalseValue, nil + } + case token.Greater: + switch rhs := rhs.(type) { + case *String: + if o.Value > rhs.Value { + return TrueValue, nil + } + return FalseValue, nil + } + case token.GreaterEq: + switch rhs := rhs.(type) { + case *String: + if o.Value >= rhs.Value { + return TrueValue, nil + } + return FalseValue, nil + } } return nil, ErrInvalidOperator } -- cgit v1.2.3