summaryrefslogtreecommitdiffstats
path: root/model-integration/src/main/javacc/ModelParser.jj
diff options
context:
space:
mode:
Diffstat (limited to 'model-integration/src/main/javacc/ModelParser.jj')
-rw-r--r--model-integration/src/main/javacc/ModelParser.jj9
1 files changed, 2 insertions, 7 deletions
diff --git a/model-integration/src/main/javacc/ModelParser.jj b/model-integration/src/main/javacc/ModelParser.jj
index 5dde54e88e2..a7822cd1a00 100644
--- a/model-integration/src/main/javacc/ModelParser.jj
+++ b/model-integration/src/main/javacc/ModelParser.jj
@@ -180,12 +180,7 @@ void function() :
")"
lbrace() expression = expression() (<NL>)* <RBRACE> )
{
- try {
- model.expression(name, new RankingExpression(expression));
- }
- catch (com.yahoo.searchlib.rankingexpression.parser.ParseException e) {
- throw new IllegalArgumentException("Could not parse function '" + name + "'", e);
- }
+ model.expression(name, expression);
}
}
@@ -280,7 +275,7 @@ Tensor largeConstantBody(String name) :
)+
{
try {
- return JsonFormat.decode(type, IOUtils.readFileBytes(new File(new File(model.source()).getParent(), path)));
+ return JsonFormat.decode(type, IOUtils.readFileBytes(model.relativeFile(path, "constant '" + name + "'")));
}
catch (Exception e) {
throw new IllegalArgumentException("Could not read constant '" + name + "'", e);