func newSargLT(expr *expression.LT) *sargLT { rv := &sargLT{} rv.sarg = func(expr2 expression.Expression) (Spans, error) { if expr.EquivalentTo(expr2) { return _SELF_SPANS, nil } var exprs expression.Expressions span := &Span{} if expr.First().EquivalentTo(expr2) { exprs = expression.Expressions{expr.Second().Static()} span.Range.High = exprs } else if expr.Second().EquivalentTo(expr2) { exprs = expression.Expressions{expr.First().Static()} span.Range.Low = exprs } if len(exprs) == 0 { return nil, nil } span.Range.Inclusion = datastore.NEITHER return Spans{span}, nil } return rv }
func (this *JSConverter) VisitLT(expr *expression.LT) (interface{}, error) { var buf bytes.Buffer buf.WriteString("(") buf.WriteString(this.Visit(expr.First())) buf.WriteString(" < ") buf.WriteString(this.Visit(expr.Second())) buf.WriteString(")") return buf.String(), nil }
func (this *subsetLT) VisitLT(expr *expression.LT) (interface{}, error) { if this.lt.First().EquivalentTo(expr.First()) { return LessThanOrEquals(this.lt.Second(), expr.Second()), nil } if this.lt.Second().EquivalentTo(expr.Second()) { return LessThanOrEquals(expr.First(), this.lt.First()), nil } return false, nil }