aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/main/java/com/yahoo
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-09-27 13:57:55 +0200
committerJon Bratseth <bratseth@gmail.com>2022-09-27 13:57:55 +0200
commit7cfc4fa47828261ee1f839a27a437d8bc49eb26f (patch)
tree08f3638b8076f812872669ddd4ff5118da4a35e0 /searchlib/src/main/java/com/yahoo
parent7d85a435f99021af72cc522dd712a99573bdfaa4 (diff)
Add binding precendence order info
Diffstat (limited to 'searchlib/src/main/java/com/yahoo')
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ArithmeticOperator.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ArithmeticOperator.java b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ArithmeticOperator.java
index 799f0b3de55..a2521398529 100644
--- a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ArithmeticOperator.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/ArithmeticOperator.java
@@ -39,16 +39,22 @@ struct Or : OperatorHelper<Or> { Or() : Helper("||
MULTIPLY("*", (x, y) -> x.multiply(y)),
DIVIDE("/", (x, y) -> x.divide(y)),
MODULO("%", (x, y) -> x.modulo(y)),
- POWER("^", (x, y) -> x.power(y));
+ POWER("^", true, (x, y) -> x.power(y));
/** A list of all the operators in this in order of decreasing precedence */
public static final List<ArithmeticOperator> operatorsByPrecedence = Arrays.stream(ArithmeticOperator.values()).toList();
private final String image;
+ private final boolean bindsRight; // TODO: Implement
private final BiFunction<Value, Value, Value> function;
ArithmeticOperator(String image, BiFunction<Value, Value, Value> function) {
+ this(image, false, function);
+ }
+
+ ArithmeticOperator(String image, boolean bindsRight, BiFunction<Value, Value, Value> function) {
this.image = image;
+ this.bindsRight = bindsRight;
this.function = function;
}