aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-11-19 21:12:12 +0100
committerJon Bratseth <bratseth@gmail.com>2021-11-19 21:12:12 +0100
commit290febece884167f970d4c0c1baea9339c230a91 (patch)
tree152437e0dfa6c21389918b8c69a003488242ed7d
parenta6731b58aa5b50c14b5fa1c90d07dc25eef25a40 (diff)
Various fixes
-rw-r--r--integration/intellij/BACKLOG.md4
-rw-r--r--integration/intellij/src/main/bnf/ai/vespa/intellij/schema/parser/sd.bnf13
-rw-r--r--integration/intellij/src/main/jflex/ai/vespa/intellij/schema/lexer/sd.flex2
3 files changed, 12 insertions, 7 deletions
diff --git a/integration/intellij/BACKLOG.md b/integration/intellij/BACKLOG.md
index e456aabc800..aaef8ddd411 100644
--- a/integration/intellij/BACKLOG.md
+++ b/integration/intellij/BACKLOG.md
@@ -35,3 +35,7 @@ They are not marked as errors.
Type suggestions should include all primitive types, not just annotations
Even if the parser continues, only the first error in a file is marked.
+
+Aliases with dot does not work.
+
+
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 d51f061b540..6be7302a28c 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
@@ -32,7 +32,7 @@
COMMENT = 'regexp:#.*'
SYMBOL = 'regexp:[!$|:{}(),.\[\]]'
COMPARISON_OPERATOR = 'regexp:[<>]|(==)|(<=)|(>=)|(~=)'
- ARITHMETIC_OPERATOR = 'regexp:[\-+*/]'
+ ARITHMETIC_OPERATOR = 'regexp:[\-+*/%]'
INTEGER_REG = 'regexp:[0-9]+'
FLOAT_REG = 'regexp:[0-9]+[.][0-9]+[e]?'
STRING_REG = 'regexp:\"([^\"\\]*(\\.[^\"\\]*)*)\"'
@@ -44,7 +44,7 @@ SdFile ::= SchemaDefinition | DocumentDefinition
SchemaDefinition ::= (search | schema) IdentifierVal? (inherits IdentifierVal)? '{' SchemaBody '}'
SchemaBody ::= SchemaBodyOptions* DocumentDefinition SchemaBodyOptions* // Does not support zero-or-one occurrences
private SchemaBodyOptions ::= SchemaFieldDefinition | ImportFieldDefinition | DocumentSummaryDefinition |
- RankProfileDefinition | IndexDefinition |
+ RankProfileDefinition | IndexDefinition | DocumentStructDefinition |
FieldSetDefinition | ConstantDefinition | OnnxModelDefinition | StemmingDefinition |
raw-as-base64-in-summary | SchemaAnnotationDefinition
@@ -170,7 +170,7 @@ RankPropertiesBody ::= (RankPropertiesKey ':' RankPropertiesValue)+
RankPropertiesKey ::= (IdentifierWithDashVal | STRING_REG | '(' | ')' | '.' | ',' | '$' | INTEGER_REG)+
RankPropertiesValue ::= (('-')? INTEGER_REG) | (('-')? FLOAT_REG) | WORD_REG | IdentifierVal | STRING_REG
-FunctionDefinition ::= (function | macro) inline? IdentifierVal '(' (ArgumentDefinition (',' ArgumentDefinition)*)? ')'
+FunctionDefinition ::= (function | macro) inline? IdentifierVal ( '()' | '(' (ArgumentDefinition (',' ArgumentDefinition)*)? ')' )
'{' ExpressionDefinition '}'
{ mixin="ai.vespa.intellij.schema.psi.impl.SdNamedElementImpl"
implements=["ai.vespa.intellij.schema.psi.SdFunctionDefinitionInterface" "ai.vespa.intellij.schema.psi.SdNamedElement"]
@@ -237,7 +237,7 @@ private DocumentFieldBodyOptions ::= StructFieldDefinition | MatchDefinition | I
AliasDefinition | RankDefinition | IndexingRewriteState | QueryCommandDefinition | SummaryDefinition |
BoldingDefinition | (id ':' INTEGER_REG) | IndexDefinition | (normalizing ':' IdentifierWithDashVal) |
SortingDefinition | StemmingDefinition | (weight ':' INTEGER_REG) | WeightedSetDefinition |
- RankTypeDefinition | DictionaryDefinition | SummaryToDefinition | body
+ RankTypeDefinition | DictionaryDefinition | SummaryToDefinition | header | body
//***** Field's body elements ******//
// Struct
StructFieldDefinition ::= struct-field IdentifierVal ('.' IdentifierVal)? '{' StructFieldBody '}'
@@ -256,7 +256,8 @@ MatchProperty ::= text | token | exact | (exact-terminator ':' STRING_REG) | wor
IndexingDefinition ::= indexing ((':' IndexingStatement) | ('{' IndexingStatement+ '}'))
IndexingStatement ::= IndexingStatementOptions (('|' IndexingStatementOptions)*) (';')?
// Does not support zero-or-one occurrences
-IndexingStatementOptions ::= summary | attribute | index | set_language | lowercase | (input (IdentifierVal | IndexingStuff)+) |
+IndexingStatementOptions ::= summary | attribute | index | set_language | lowercase |
+ (input (IdentifierVal | IndexingStuff)+) |
('{' IndexingStatementOptions '}') | IndexingStuff+
private IndexingStuff ::= WordWrapper | INTEGER_REG | FLOAT_REG | STRING_REG | ('{' IndexingStatement '}') |
':' | ('|' IndexingStatementOptions) | ';' | '.' | '(' | ')' | ARITHMETIC_OPERATOR | COMPARISON_OPERATOR
@@ -266,7 +267,7 @@ SimpleAttributeProperty ::= fast-search | fast-access | paged | mutable | enable
ComplexAttributeProperty ::= AliasDefinition | SortingDefinition | DistanceMetricDef // Does not support zero-or-one occurrences
DistanceMetricDef ::= distance-metric ':' IdentifierWithDashVal
// Alias
-AliasDefinition ::= alias (IdentifierWithDashVal ('.' IdentifierWithDashVal)*)? ':' IdentifierWithDashVal ('.' IdentifierWithDashVal)*
+AliasDefinition ::= alias (IdentifierVal)? ':' IdentifierWithDashVal ('.' IdentifierWithDashVal)*
// Stemming
StemmingDefinition ::= stemming ':' IdentifierWithDashVal
// Rank
diff --git a/integration/intellij/src/main/jflex/ai/vespa/intellij/schema/lexer/sd.flex b/integration/intellij/src/main/jflex/ai/vespa/intellij/schema/lexer/sd.flex
index b4491acc717..78334de1961 100644
--- a/integration/intellij/src/main/jflex/ai/vespa/intellij/schema/lexer/sd.flex
+++ b/integration/intellij/src/main/jflex/ai/vespa/intellij/schema/lexer/sd.flex
@@ -38,7 +38,7 @@ SYMBOL= [!$|:{}(),.\[\]]
INTEGER = [0-9]+
FLOAT = {INTEGER}[.][0-9]+[e]?
COMPARISON_OPERATOR = [<>]|(==)|(<=)|(>=)|(\~=)
-ARITHMETIC_OPERATOR = [\-+*/]
+ARITHMETIC_OPERATOR = [\-+*/%]
STRING = \"([^\"\\]*(\\.[^\"\\]*)*)\"
WORD = \w+