aboutsummaryrefslogtreecommitdiffstats
path: root/integration
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-05-18 14:19:52 +0200
committerJon Bratseth <bratseth@gmail.com>2022-05-18 14:19:52 +0200
commit8aafdb9f38f71161a7786c03c3f2f97b2d02f688 (patch)
treef5b0e4c4cc58bb584fbb072cf9747f39a8ddf939 /integration
parent16de8d32fd0394335ffa065b61f4943c4fd49542 (diff)
Support new syntax
Diffstat (limited to 'integration')
-rw-r--r--integration/intellij/build.gradle8
-rw-r--r--integration/intellij/pom.xml2
-rw-r--r--integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf35
3 files changed, 29 insertions, 16 deletions
diff --git a/integration/intellij/build.gradle b/integration/intellij/build.gradle
index 1c2dae46d87..4374f6f964a 100644
--- a/integration/intellij/build.gradle
+++ b/integration/intellij/build.gradle
@@ -36,7 +36,7 @@ compileJava {
}
group 'ai.vespa'
-version '1.1.5' // Also update pom.xml version if this is changed
+version '1.1.6' // Also update pom.xml version if this is changed
sourceCompatibility = 11
@@ -64,8 +64,10 @@ patchPluginXml {
untilBuild = '213.*'
// in changeNotes you can add a description of the changes in this version (would appear in the plugin page in preferences\plugins)
changeNotes = """
- Support for inputs in rank profiles.
- Correct parsing of lambda expressions.
+ Support for default values in inputs.
+ Support for unified constant syntax.
+ Support all tensor formats.
+ Support tensor generate functions.
"""
}
diff --git a/integration/intellij/pom.xml b/integration/intellij/pom.xml
index 1c973b84d37..3f2a4c24771 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.5</version> <!-- See copy-zip below, which depends on this being the same as the v. in build.gradle -->
+ <version>1.1.6</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 b0e0e5e61dc..87c4a012fb5 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
@@ -91,7 +91,7 @@ private UriPath ::= ('H'|'h') ('T'|'t') ('T'|'t') ('P'|'p') ('S'|'s')? ':' ('//'
OnnxModelDefinition ::= onnx-model IdentifierVal '{' OnnxModelBody '}'
OnnxModelBody ::= OnnxModelBodyOptions*
private OnnxModelBodyOptions ::= (file ':' FilePath) | (uri ':' UriPath) |
- ((input | output) (IdentifierVal | STRING_REG) ':' ('.' | '/' | '(' | ')' | IdentifierWithDashVal | WORD_REG))
+ ((input | output) (RankFeature | IdentifierVal | STRING_REG) ':' ('.' | '/' | '(' | ')' | IdentifierWithDashVal | WORD_REG))
SchemaAnnotationDefinition ::= AnnotationDefinition
{ mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl"
@@ -110,7 +110,7 @@ AnnotationFieldDefinition ::= field IdentifierVal type FieldTypeName '{' '}'
// NOTE: These must end by "Expr" - see this line above: extends(".*Expr")=RankingExpression
// The *Expr alternatives are consumed greedily so order matters.
//-------------------------
-RankingExpression ::= LiteralTensorExpr | FilePathExpr | ParenthesisedExpr | BooleanExpr | ArithmeticExpr | IfFunctionExpr |
+RankingExpression ::= LiteralOrGenerateTensorExpr | FilePathExpr | ParenthesisedExpr | BooleanExpr | ArithmeticExpr | IfFunctionExpr |
QueryDefinitionExpr | FunctionCallOrLambdaExpr | InListRankingExpr | PrimitiveExpr | SliceExpr
FilePathExpr ::= file ':' (FilePath | WordWrapper)
@@ -139,6 +139,8 @@ PrimitiveExpr ::= ( (('-')? INTEGER_REG) | (('-')? FLOAT_REG) | IdentifierVal |
SliceExpr ::= RankingExpression ( SliceKey | SliceIndex | FullTensorAddress )
+GenerateExpr ::= TensorType ParenthesisedExpr
+
SliceKey ::= '{' Label '}'
SliceIndex ::= '[' RankingExpression ']'
@@ -148,13 +150,16 @@ KeyValue ::= IdentifierVal ':' ( Label | RankingExpression )
Label ::= IdentifierVal | STRING_REG
-LiteralTensorExpr ::= TensorType ':' '{' TensorValue ( ',' TensorValue )* '}'
-
-TensorValue ::= CellAddress ':' RankingExpression
-
-CellAddress ::= Label | FullTensorAddress
+LiteralOrGenerateTensorExpr ::= TensorType (
+ ( ':' TensorValue ) | // literal verbose form tensor
+ ParenthesisedExpr // generate tensor
+ )
-LambdaExpr ::= IdentifierWithDashVal '(' IdentifierVal (COMMA IdentifierVal)* ')' ParenthesisedExpr
+TensorValue ::= MappedTensorValue | ArrayTensorValues
+MappedTensorValue ::= '{' MappedTensorBlock ( ',' MappedTensorBlock )* '}'
+MappedTensorBlock ::= TensorAddress ':' ( FLOAT_REG | ArrayTensorValues )
+ArrayTensorValues ::= '[' ( FLOAT_REG | ArrayTensorValues ) ( ',' ( FLOAT_REG | ArrayTensorValues ) )* ']'
+TensorAddress ::= Label | FullTensorAddress
//-------------------------
//-- Rank Profile rules ---
@@ -187,8 +192,10 @@ private MinHitsDefinition ::= min-hits-per-thread ':' ('-')? INTEGER_REG
private NumSearchPartitionDefinition ::= num-search-partition ':' INTEGER_REG
FieldWeightDefinition ::= weight DottedIdentifiers ':' INTEGER_REG
StrictDefinition ::= strict ':' (true | false)
-InputsDefinition ::= inputs '{' InputsBody '}'
-InputsBody ::= (QueryDefinition TensorType)*
+InputsDefinition ::= inputs '{' InputDefinition* '}'
+InputDefinition ::= ( QueryDefinition | IdentifierVal)
+ (':')?
+ ( TensorType | "double" )? (':' ( TensorValue | FLOAT_REG | INTEGER_REG) )?
FirstPhaseDefinition ::= first-phase '{' FirstPhaseBody '}' { mixin="ai.vespa.intellij.schema.psi.impl.SdFirstPhaseDefinitionMixin" }
FirstPhaseBody ::= FirstPhaseBodyOptions* // Does not support zero-or-one occurrences
@@ -216,12 +223,16 @@ ArgumentDefinition ::= IdentifierVal
}
SummaryFeaturesDefinition ::= summary-features ((':' RankFeature+) | ((inherits IdentifierWithDashVal)? '{' RankFeature* '}'))
-
+i
MatchFeaturesDefinition ::= match-features ((':' RankFeature+) | ((inherits IdentifierWithDashVal)? '{' RankFeature* '}'))
RankFeaturesDefinition ::= rank-features ((':' RankFeature+) | ('{' RankFeature* '}'))
-ConstantsDefinition ::= constants '{' (IdentifierVal ':' RankPropertiesValue)* '}'
+ConstantsDefinition ::= constants '{' InnerConstantDefinition* '}'
+
+InnerConstantDefinition ::= ( ("constant" '(' IdentifierVal ')') | IdentifierVal )
+ (':')? ( TensorType | "double" )?
+ (':')? ( TensorValue | FLOAT_REG | INTEGER_REG | (file ':' FilePath) | (uri ':' UriPath))
RankFeature ::= QueryDefinition | ItemRawScoreDefinition | FunctionCallExpr | DottedIdentifierWithDash
QueryDefinition ::= "query" '(' IdentifierWithDashVal ')'