diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-09-27 13:57:55 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-09-27 13:57:55 +0200 |
commit | 7cfc4fa47828261ee1f839a27a437d8bc49eb26f (patch) | |
tree | 08f3638b8076f812872669ddd4ff5118da4a35e0 /searchlib/src/main/java/com/yahoo | |
parent | 7d85a435f99021af72cc522dd712a99573bdfaa4 (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.java | 8 |
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; } |