mirror of
https://github.com/MontFerret/ferret.git
synced 2025-08-15 20:02:56 +02:00
Next (#214)
* Renamed DOCUMENT to PAGE * Added PageLoadParams * Added PageLoadParams * Renamed LoadPageParams -> PageLoadParams * Added support for context.Done() (#201) * Bug/#189 operators precedence (#202) * Fixed math operators precedence * Fixed logical operators precedence * Fixed array operator * Added support for parentheses to enforce a different operator evaluation order * Feature/#200 drivers (#209) * Added new interfaces * Renamed dynamic to cdp driver * Renamed drivers * Added ELEMENT_EXISTS function (#210) * Renamed back PAGE to DOCUMENT (#211) * Added Getter and Setter interfaces
This commit is contained in:
@@ -8,8 +8,10 @@ import (
|
||||
|
||||
type (
|
||||
MathOperatorType string
|
||||
MathOperator struct {
|
||||
|
||||
MathOperator struct {
|
||||
*baseOperator
|
||||
opType MathOperatorType
|
||||
fn OperatorFunc
|
||||
leftOnly bool
|
||||
}
|
||||
@@ -55,11 +57,16 @@ func NewMathOperator(
|
||||
|
||||
return &MathOperator{
|
||||
&baseOperator{src, left, right},
|
||||
operator,
|
||||
fn,
|
||||
leftOnly,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (operator *MathOperator) Type() MathOperatorType {
|
||||
return operator.opType
|
||||
}
|
||||
|
||||
func (operator *MathOperator) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) {
|
||||
left, err := operator.left.Exec(ctx, scope)
|
||||
|
||||
|
Reference in New Issue
Block a user