diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-06-06 09:36:51 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-06-06 09:36:51 +0200 |
commit | 3344c999c2721b75666e2e49f7fd6f15c9fe1353 (patch) | |
tree | 1d0084ff7c5037774d8740ce9dd5a7777c9367f7 /model-integration/src/main/javacc/ModelParser.jj | |
parent | 3e1ef49b358ef027311d1d44d846695ea46125b8 (diff) |
Expression file references in Vespa models
Diffstat (limited to 'model-integration/src/main/javacc/ModelParser.jj')
-rw-r--r-- | model-integration/src/main/javacc/ModelParser.jj | 9 |
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); |