diff options
author | 2016-07-13 16:22:30 +0000 | |
---|---|---|
committer | 2016-07-14 11:12:15 +0000 | |
commit | bc47f40b0dd352d3bf9dc8228fbf0279ac67e907 (patch) | |
tree | 93ac0e8ae932517d4b080769b95345fd338767c7 /src/main/java/com/google/devtools/build/lib/query2/engine/BinaryOperatorExpression.java | |
parent | 80d1e16b7ae1d04fa2fa4c561588fe9fdbaefc41 (diff) |
Re-implement variables in the blaze query language. Instead of using a mutable global context of variable bindings, pass around immutable local contexts.
The motivation is so we can safely evaluate all blaze query expressions concurrently under the hood. A global context is hostile to this goal.
--
MOS_MIGRATED_REVID=127324600
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/query2/engine/BinaryOperatorExpression.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/query2/engine/BinaryOperatorExpression.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/engine/BinaryOperatorExpression.java b/src/main/java/com/google/devtools/build/lib/query2/engine/BinaryOperatorExpression.java index 8da82b2f72..987e8fd9b4 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/engine/BinaryOperatorExpression.java +++ b/src/main/java/com/google/devtools/build/lib/query2/engine/BinaryOperatorExpression.java @@ -53,19 +53,19 @@ public class BinaryOperatorExpression extends QueryExpression { } @Override - public <T> void eval(QueryEnvironment<T> env, Callback<T> callback) + public <T> void eval(QueryEnvironment<T> env, VariableContext<T> context, Callback<T> callback) throws QueryException, InterruptedException { if (operator == TokenKind.PLUS || operator == TokenKind.UNION) { for (QueryExpression operand : operands) { - env.eval(operand, callback); + env.eval(operand, context, callback); } return; } // We cannot do differences with partial results. So we fully evaluate the operands - Set<T> lhsValue = QueryUtil.evalAll(env, operands.get(0)); + Set<T> lhsValue = QueryUtil.evalAll(env, context, operands.get(0)); for (int i = 1; i < operands.size(); i++) { - Set<T> rhsValue = QueryUtil.evalAll(env, operands.get(i)); + Set<T> rhsValue = QueryUtil.evalAll(env, context, operands.get(i)); switch (operator) { case INTERSECT: case CARET: |