From ce25459c89b83e093b581cbd4564f88060352982 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Mon, 30 May 2022 12:25:04 +0200 Subject: Grammar fixes --- .../bnf/ai/vespa/intellij/schema/parser/sd.bnf | 2 +- .../applications/rankprofilemodularity/test.sd | 1 + .../test/outside_schema1.profile | 1 + .../test/outside_schema2.profile | 1 + .../test/applications/schemainheritance/child.sd | 1 + .../schemainheritance/importedschema.sd | 1 + .../test/applications/schemainheritance/parent.sd | 1 + .../src/test/applications/simple/simple.sd | 1 + .../src/test/applications/syntax/syntax.sd | 29 ++++++++++++++++++++++ 9 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 integration/intellij/src/test/applications/syntax/syntax.sd (limited to 'integration/intellij/src') 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 e7ee550a741..efe790d78e7 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 @@ -323,7 +323,7 @@ IndexingExpression ::= (input ( DottedIdentifier | IndexingStuff )+ )+ | IndexingStuff+ | ( WordWrapper? BlockStart (NL | IndexingStatement)* BlockEnd) | // TODO: Parse advanced indexing statements properly -private IndexingStuff ::= WordWrapper | AnyNumber | STRING_REG | +private IndexingStuff ::= WordWrapper | AnyNumber | STRING_REG | BlockStart | BlockEnd | ':' | '.' | '(' | ')' | ArithmeticOperator | ComparisonOperator // Attribute diff --git a/integration/intellij/src/test/applications/rankprofilemodularity/test.sd b/integration/intellij/src/test/applications/rankprofilemodularity/test.sd index 013881248c1..f9ccf29a94e 100644 --- a/integration/intellij/src/test/applications/rankprofilemodularity/test.sd +++ b/integration/intellij/src/test/applications/rankprofilemodularity/test.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema test { document test { diff --git a/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema1.profile b/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema1.profile index af27290c5f7..2e5f56fd18b 100644 --- a/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema1.profile +++ b/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema1.profile @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. rank-profile outside_schema1 inherits in_schema1 { function fo1() { diff --git a/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema2.profile b/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema2.profile index 8cf3fcfbb78..7dd41859d03 100644 --- a/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema2.profile +++ b/integration/intellij/src/test/applications/rankprofilemodularity/test/outside_schema2.profile @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. rank-profile outside_schema2 { function fo2() { diff --git a/integration/intellij/src/test/applications/schemainheritance/child.sd b/integration/intellij/src/test/applications/schemainheritance/child.sd index ff09bad4442..d4ab271bdef 100644 --- a/integration/intellij/src/test/applications/schemainheritance/child.sd +++ b/integration/intellij/src/test/applications/schemainheritance/child.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema child inherits parent { document child inherits parent { diff --git a/integration/intellij/src/test/applications/schemainheritance/importedschema.sd b/integration/intellij/src/test/applications/schemainheritance/importedschema.sd index 1b5acff8a26..29802ab99cc 100644 --- a/integration/intellij/src/test/applications/schemainheritance/importedschema.sd +++ b/integration/intellij/src/test/applications/schemainheritance/importedschema.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema importedschema { document importedschema { diff --git a/integration/intellij/src/test/applications/schemainheritance/parent.sd b/integration/intellij/src/test/applications/schemainheritance/parent.sd index ba666313af1..c2dea4071a3 100644 --- a/integration/intellij/src/test/applications/schemainheritance/parent.sd +++ b/integration/intellij/src/test/applications/schemainheritance/parent.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema parent { document parent { diff --git a/integration/intellij/src/test/applications/simple/simple.sd b/integration/intellij/src/test/applications/simple/simple.sd index 21e683b3ee4..ff56944440b 100644 --- a/integration/intellij/src/test/applications/simple/simple.sd +++ b/integration/intellij/src/test/applications/simple/simple.sd @@ -1,3 +1,4 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. schema simple { document simple { diff --git a/integration/intellij/src/test/applications/syntax/syntax.sd b/integration/intellij/src/test/applications/syntax/syntax.sd new file mode 100644 index 00000000000..1e1087b45e1 --- /dev/null +++ b/integration/intellij/src/test/applications/syntax/syntax.sd @@ -0,0 +1,29 @@ +# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +# A collection of syntax we can visually check is parsed correctly +schema syntax { + document syntax { + field mystring type string { + } + } + + field myarray1 type array { + indexing: input mystring | split ";" | for_each { trim } | attribute + } + + field myarray2 type array { + indexing: input mystring | split ";" | for_each { trim } | attribute + index: enable-bm25 + } + + field myarray2 type array { + indexing { + input mystring | split ";" | for_each { + trim + } + | attribute; + } + index: enable-bm25 + } + +} \ No newline at end of file -- cgit v1.2.3