summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-04-25 18:32:59 +0200
committerJon Bratseth <bratseth@gmail.com>2022-04-25 18:32:59 +0200
commit70b52e53733914702e38f82cb0308e8024fbacef (patch)
tree134f8f319ca94908c577d04dd979f180b22c9245
parent2d2a7d4a0bd306c7f9056fe80514af2e3a7d2661 (diff)
Faster lambda parsing
-rw-r--r--config-model/src/test/derived/neuralnet_noqueryprofile/neuralnet.sd6
-rw-r--r--integration/intellij/build.gradle2
-rw-r--r--integration/intellij/pom.xml2
-rw-r--r--integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf8
4 files changed, 12 insertions, 6 deletions
diff --git a/config-model/src/test/derived/neuralnet_noqueryprofile/neuralnet.sd b/config-model/src/test/derived/neuralnet_noqueryprofile/neuralnet.sd
index 4241e9dab85..9069f59bbe3 100644
--- a/config-model/src/test/derived/neuralnet_noqueryprofile/neuralnet.sd
+++ b/config-model/src/test/derived/neuralnet_noqueryprofile/neuralnet.sd
@@ -69,7 +69,7 @@ search neuralnet {
}
- rank-profile defaultRankProfile inherits default {
+ rank-profile default {
inputs {
query(W_0) tensor(x[9],hidden[9])
@@ -80,6 +80,10 @@ search neuralnet {
query(b_out) tensor(out[1])
}
+ }
+
+ rank-profile defaultRankProfile inherits default {
+
constants {
maxSignedSixtyFourBitInteger: 9223372036854775807
}
diff --git a/integration/intellij/build.gradle b/integration/intellij/build.gradle
index 6bc385a983c..1c2dae46d87 100644
--- a/integration/intellij/build.gradle
+++ b/integration/intellij/build.gradle
@@ -36,7 +36,7 @@ compileJava {
}
group 'ai.vespa'
-version '1.1.4' // Also update pom.xml version if this is changed
+version '1.1.5' // Also update pom.xml version if this is changed
sourceCompatibility = 11
diff --git a/integration/intellij/pom.xml b/integration/intellij/pom.xml
index 07488ed3d93..1c973b84d37 100644
--- a/integration/intellij/pom.xml
+++ b/integration/intellij/pom.xml
@@ -9,7 +9,7 @@
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>vespa-intellij</artifactId> <!-- Not used - plugin is build by gradle -->
- <version>1.1.4</version> <!-- See copy-zip below, which depends on this being the same as the v. in build.gradle -->
+ <version>1.1.5</version> <!-- See copy-zip below, which depends on this being the same as the v. in build.gradle -->
<description>
Maven wrapper for the gradle build of this IntelliJ plugin.
</description>
diff --git a/integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf b/integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf
index cb4bc024c86..b0e0e5e61dc 100644
--- a/integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf
+++ b/integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf
@@ -111,7 +111,7 @@ AnnotationFieldDefinition ::= field IdentifierVal type FieldTypeName '{' '}'
// The *Expr alternatives are consumed greedily so order matters.
//-------------------------
RankingExpression ::= LiteralTensorExpr | FilePathExpr | ParenthesisedExpr | BooleanExpr | ArithmeticExpr | IfFunctionExpr |
- QueryDefinitionExpr | FunctionCallExpr | InListRankingExpr | PrimitiveExpr | SliceExpr | LambdaExpr
+ QueryDefinitionExpr | FunctionCallOrLambdaExpr | InListRankingExpr | PrimitiveExpr | SliceExpr
FilePathExpr ::= file ':' (FilePath | WordWrapper)
@@ -129,7 +129,9 @@ ArithmeticOperator ::= '+' | '-' | '*' | '/' | '%' | '^' | "||" | "&&"
QueryDefinitionExpr ::= QueryDefinition | ItemRawScoreDefinition
-FunctionCallExpr ::= IdentifierWithDashVal '(' RankingExpression (COMMA RankingExpression)* ')' ('.' IdentifierWithDashVal)?
+// Rough parsing but hard to do better due to greediness: If this is a lambda arg expressions must be identifiers
+FunctionCallOrLambdaExpr ::= IdentifierWithDashVal '(' RankingExpression (COMMA RankingExpression)* ')' ('.' IdentifierWithDashVal)?
+ ParenthesisedExpr? // This turns the function call into a lambda
ParenthesisedExpr ::= '(' RankingExpression ')'
@@ -152,7 +154,7 @@ TensorValue ::= CellAddress ':' RankingExpression
CellAddress ::= Label | FullTensorAddress
-LambdaExp ::= FunctionCallExpr ParenthesisedExpr
+LambdaExpr ::= IdentifierWithDashVal '(' IdentifierVal (COMMA IdentifierVal)* ')' ParenthesisedExpr
//-------------------------
//-- Rank Profile rules ---