summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/d5/tengo/v2/objects.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-07-18 17:27:41 +0200
committerGitHub <noreply@github.com>2020-07-18 17:27:41 +0200
commit23d8742f0d95096b92f11729fb47f86ac3b68d43 (patch)
tree7b8acb02b051ae06e5454fda4a9d5118428fe016 /vendor/github.com/d5/tengo/v2/objects.go
parent3b6a8be07b9422714db30fb50977f342057febf3 (diff)
downloadmatterbridge-msglm-23d8742f0d95096b92f11729fb47f86ac3b68d43.tar.gz
matterbridge-msglm-23d8742f0d95096b92f11729fb47f86ac3b68d43.tar.bz2
matterbridge-msglm-23d8742f0d95096b92f11729fb47f86ac3b68d43.zip
Update dependencies for 1.18.0 release (#1175)
Diffstat (limited to 'vendor/github.com/d5/tengo/v2/objects.go')
-rw-r--r--vendor/github.com/d5/tengo/v2/objects.go32
1 files changed, 32 insertions, 0 deletions
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
}