aboutsummaryrefslogtreecommitdiffstats
path: root/indexinglanguage/src/main/javacc/IndexingParser.jj
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@vespa.ai>2023-09-27 17:28:13 +0200
committerJon Bratseth <bratseth@vespa.ai>2023-09-27 17:28:13 +0200
commit12f9d93fd13a74eb022e8ef0633ff3b1456d345b (patch)
tree82372d0c09dc09dedf9f55bf4290b2e12bbc3cb0 /indexinglanguage/src/main/javacc/IndexingParser.jj
parentb4af421142168c36cc1e8c9bae735731a68fcb20 (diff)
Return the expected output
In if-else expressions, return the output of the executed branch rather than the input. The current behavior was undocumented and quite unexpected, so I suggest we treat that as a bug. Also return the last executed expression in a script as its output (rather than nothing. In addition, improve some error messages.
Diffstat (limited to 'indexinglanguage/src/main/javacc/IndexingParser.jj')
-rw-r--r--indexinglanguage/src/main/javacc/IndexingParser.jj4
1 files changed, 2 insertions, 2 deletions
diff --git a/indexinglanguage/src/main/javacc/IndexingParser.jj b/indexinglanguage/src/main/javacc/IndexingParser.jj
index d559d9b7260..02372fcadbd 100644
--- a/indexinglanguage/src/main/javacc/IndexingParser.jj
+++ b/indexinglanguage/src/main/javacc/IndexingParser.jj
@@ -32,7 +32,6 @@ import com.yahoo.document.datatypes.*;
import com.yahoo.text.StringUtilities;
import com.yahoo.vespa.indexinglanguage.expressions.*;
import com.yahoo.vespa.indexinglanguage.linguistics.AnnotatorConfig;
-import com.yahoo.language.process.StemMode;
import com.yahoo.language.process.Embedder;
import com.yahoo.language.Linguistics;
@@ -100,6 +99,7 @@ public class IndexingParser {
return new LongFieldValue(new BigInteger(str).longValue());
}
}
+}}
}
PARSER_END(IndexingParser)
@@ -592,7 +592,7 @@ Expression setValueExp() :
}
{
( val = fieldValue() )
- { return new SetValueExpression(val); }
+ { return new ConstantExpression(val); }
}
Expression setVarExp() :