summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2017-11-03 11:44:25 +0000
committerHåvard Pettersen <havardpe@oath.com>2017-11-03 12:35:31 +0000
commit228a4f089d2431bf2012982bce9e093f2df2dead (patch)
tree01119a93d453585edf6c88017c24abff534b0b21 /searchlib
parent5a69cb546ad5661001c89eecbf13c8b41b57019c (diff)
handle 'in' operator as custom (tensor) map operation
free arrays no longer allowed restrict set members to be numbers or strings auto-unbox negative numbers in AST
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp
index 550cd651c2b..7e8b5a85448 100644
--- a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp
+++ b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp
@@ -105,21 +105,11 @@ struct FunctionInfo {
void check_in(const In *node) {
if (node) {
- auto lhs_symbol = as<Symbol>(node->lhs());
- auto rhs_symbol = as<Symbol>(node->rhs());
- if (lhs_symbol && node->rhs().is_const()) {
- auto array = as<Array>(node->rhs());
- if (array) {
- for (size_t i = 0; i < array->size(); ++i) {
- inputs[lhs_symbol->id()].cmp_with.push_back(array->get(i).get_const_value());
- }
- } else {
- inputs[lhs_symbol->id()].cmp_with.push_back(node->rhs().get_const_value());
+ if (auto symbol = as<Symbol>(node->child())) {
+ for (size_t i = 0; i < node->num_entries(); ++i) {
+ inputs[symbol->id()].cmp_with.push_back(node->get_entry(i).get_const_value());
}
}
- if (node->lhs().is_const() && rhs_symbol) {
- inputs[rhs_symbol->id()].cmp_with.push_back(node->lhs().get_const_value());
- }
}
}