diff --git a/compiler/frontend/src/org/jetbrains/kotlin/JetNodeTypes.java b/compiler/frontend/src/org/jetbrains/kotlin/JetNodeTypes.java index 22410e145e5..53a4f5e189c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/JetNodeTypes.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/JetNodeTypes.java @@ -38,6 +38,7 @@ public interface JetNodeTypes { IElementType ENUM_ENTRY = JetStubElementTypes.ENUM_ENTRY; IElementType ANONYMOUS_INITIALIZER = JetStubElementTypes.ANONYMOUS_INITIALIZER; IElementType SECONDARY_CONSTRUCTOR = JetStubElementTypes.SECONDARY_CONSTRUCTOR; + IElementType PRIMARY_CONSTRUCTOR = JetStubElementTypes.PRIMARY_CONSTRUCTOR; IElementType TYPE_PARAMETER_LIST = JetStubElementTypes.TYPE_PARAMETER_LIST; IElementType TYPE_PARAMETER = JetStubElementTypes.TYPE_PARAMETER; @@ -55,7 +56,6 @@ public interface JetNodeTypes { IElementType FILE_ANNOTATION_LIST = JetStubElementTypes.FILE_ANNOTATION_LIST; IElementType IMPORT_DIRECTIVE = JetStubElementTypes.IMPORT_DIRECTIVE; IElementType MODIFIER_LIST = JetStubElementTypes.MODIFIER_LIST; - IElementType PRIMARY_CONSTRUCTOR_MODIFIER_LIST = JetStubElementTypes.PRIMARY_CONSTRUCTOR_MODIFIER_LIST; IElementType ANNOTATION = JetStubElementTypes.ANNOTATION; IElementType ANNOTATION_ENTRY = JetStubElementTypes.ANNOTATION_ENTRY; diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java index 84d278d0b30..c1f1344ad7a 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java @@ -626,7 +626,8 @@ public class JetParsing extends AbstractJetParsing { OptionalMarker constructorModifiersMarker = new OptionalMarker(object); PsiBuilder.Marker beforeConstructorModifiers = mark(); - boolean hasConstructorModifiers = parseModifierList(PRIMARY_CONSTRUCTOR_MODIFIER_LIST, REGULAR_ANNOTATIONS_ONLY_WITH_BRACKETS); + PsiBuilder.Marker primaryConstructorMarker = mark(); + boolean hasConstructorModifiers = parseModifierList(MODIFIER_LIST, REGULAR_ANNOTATIONS_ONLY_WITH_BRACKETS); // Some modifiers found, but no parentheses following: class has already ended, and we are looking at something else if (hasConstructorModifiers && !atSet(LPAR, LBRACE, COLON)) { @@ -640,14 +641,19 @@ public class JetParsing extends AbstractJetParsing { if (at(LPAR)) { parseValueParameterList(false, /* typeRequired = */ true, TokenSet.create(COLON, LBRACE)); + primaryConstructorMarker.done(PRIMARY_CONSTRUCTOR); } else if (hasConstructorModifiers) { // A comprehensive error message for cases like: // class A private : Foo // or // class A private { + primaryConstructorMarker.done(PRIMARY_CONSTRUCTOR); error("Expecting primary constructor parameter list"); } + else { + primaryConstructorMarker.drop(); + } constructorModifiersMarker.error("Constructors are not allowed for objects"); if (at(COLON)) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetClass.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetClass.java index 149c218e682..44c5ae78399 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetClass.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetClass.java @@ -62,9 +62,15 @@ public class JetClass extends JetTypeParameterListOwnerStub imp return visitor.visitClass(this, data); } + @Nullable + public JetPrimaryConstructor getPrimaryConstructor() { + return getStubOrPsiChild(JetStubElementTypes.PRIMARY_CONSTRUCTOR); + } + @Nullable public JetParameterList getPrimaryConstructorParameterList() { - return getStubOrPsiChild(JetStubElementTypes.VALUE_PARAMETER_LIST); + JetPrimaryConstructor primaryConstructor = getPrimaryConstructor(); + return primaryConstructor != null ? primaryConstructor.getValueParameterList() : null; } @NotNull @@ -89,22 +95,8 @@ public class JetClass extends JetTypeParameterListOwnerStub imp @Nullable public JetModifierList getPrimaryConstructorModifierList() { - return getStubOrPsiChild(JetStubElementTypes.PRIMARY_CONSTRUCTOR_MODIFIER_LIST); - } - - public void addPrimaryConstructorModifier(@NotNull JetModifierKeywordToken modifier) { - JetModifierList modifierList = getPrimaryConstructorModifierList(); - if (modifierList != null) { - AddRemoveModifierPackage.addModifier(modifierList, modifier, JetTokens.PUBLIC_KEYWORD); - } - else { - if (modifier == JetTokens.PUBLIC_KEYWORD) return; - - JetParameterList parameterList = getPrimaryConstructorParameterList(); - assert parameterList != null; - JetModifierList newModifierList = new JetPsiFactory(getProject()).createModifierList(modifier); - addBefore(newModifierList, parameterList); - } + JetPrimaryConstructor primaryConstructor = getPrimaryConstructor(); + return primaryConstructor != null ? primaryConstructor.getModifierList() : null; } @Override diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetPrimaryConstructor.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetPrimaryConstructor.java new file mode 100644 index 00000000000..1869a567eb4 --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetPrimaryConstructor.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.psi; + +import com.intellij.lang.ASTNode; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.kotlin.lexer.JetModifierKeywordToken; +import org.jetbrains.kotlin.lexer.JetTokens; +import org.jetbrains.kotlin.psi.addRemoveModifier.AddRemoveModifierPackage; +import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub; +import org.jetbrains.kotlin.psi.stubs.elements.JetStubElementTypes; + +import java.util.Collections; +import java.util.List; + +public class JetPrimaryConstructor extends JetDeclarationStub> { + public JetPrimaryConstructor(@NotNull ASTNode node) { + super(node); + } + + public JetPrimaryConstructor(@NotNull KotlinPlaceHolderStub stub) { + super(stub, JetStubElementTypes.PRIMARY_CONSTRUCTOR); + } + + @Override + public R accept(@NotNull JetVisitor visitor, D data) { + return visitor.visitPrimaryConstructor(this, data); + } + + @Nullable + public JetParameterList getValueParameterList() { + return getStubOrPsiChild(JetStubElementTypes.VALUE_PARAMETER_LIST); + } + + @NotNull + public List getValueParameters() { + JetParameterList list = getValueParameterList(); + return list != null ? list.getParameters() : Collections.emptyList(); + } + + @Override + public void addModifier(@NotNull JetModifierKeywordToken modifier) { + JetModifierList modifierList = getModifierList(); + if (modifierList != null) { + AddRemoveModifierPackage.addModifier(modifierList, modifier, JetTokens.PUBLIC_KEYWORD); + } + else { + if (modifier == JetTokens.PUBLIC_KEYWORD) return; + + JetParameterList parameterList = getValueParameterList(); + assert parameterList != null; + JetPsiFactory psiFactory = new JetPsiFactory(getProject()); + JetModifierList newModifierList = psiFactory.createModifierList(modifier); + addBefore(newModifierList, parameterList); + } + } + + @Nullable + public JetClass getContainingClassOrNull() { + JetClassOrObject classOrObject = (JetClassOrObject) getParent(); + return classOrObject instanceof JetClass ? (JetClass) classOrObject : null; + } + + @NotNull + public JetClass getContainingClass() { + JetClass classOrNull = getContainingClassOrNull(); + assert classOrNull != null : "This method should be called when parent is JetClass"; + return classOrNull; + } +} diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetPrimaryConstructorModifierList.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetPrimaryConstructorModifierList.java deleted file mode 100644 index 9a7a9e24c0f..00000000000 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetPrimaryConstructorModifierList.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.psi; - -import com.intellij.lang.ASTNode; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.kotlin.psi.stubs.KotlinModifierListStub; -import org.jetbrains.kotlin.psi.stubs.elements.JetStubElementTypes; - -public class JetPrimaryConstructorModifierList extends JetModifierList { - public JetPrimaryConstructorModifierList(@NotNull ASTNode node) { - super(node); - } - - public JetPrimaryConstructorModifierList(@NotNull KotlinModifierListStub stub) { - super(stub, JetStubElementTypes.PRIMARY_CONSTRUCTOR_MODIFIER_LIST); - } -} diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitor.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitor.java index 25208cc716b..3f56d53bc0f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitor.java @@ -37,6 +37,10 @@ public class JetVisitor extends PsiElementVisitor { return visitJetElement(constructor, data); } + public R visitPrimaryConstructor(@NotNull JetPrimaryConstructor constructor, D data) { + return visitJetElement(constructor, data); + } + public R visitNamedFunction(@NotNull JetNamedFunction function, D data) { return visitNamedDeclaration(function, data); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitorVoid.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitorVoid.java index 7d3f3ea0456..78caf28882d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitorVoid.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitorVoid.java @@ -37,6 +37,10 @@ public class JetVisitorVoid extends JetVisitor { super.visitSecondaryConstructor(constructor, null); } + public void visitPrimaryConstructor(@NotNull JetPrimaryConstructor constructor) { + super.visitPrimaryConstructor(constructor, null); + } + public void visitNamedFunction(@NotNull JetNamedFunction function) { super.visitNamedFunction(function, null); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitorVoidWithParameter.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitorVoidWithParameter.java index 3ed1caf26ec..d0c02ed6d73 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitorVoidWithParameter.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetVisitorVoidWithParameter.java @@ -38,6 +38,10 @@ public class JetVisitorVoidWithParameter

extends JetVisitor { super.visitSecondaryConstructor(constructor, data); } + public void visitPrimaryConstructorVoid(@NotNull JetPrimaryConstructor constructor, P data) { + super.visitPrimaryConstructor(constructor, data); + } + public void visitNamedFunctionVoid(@NotNull JetNamedFunction function, P data) { super.visitNamedFunction(function, data); } @@ -441,6 +445,12 @@ public class JetVisitorVoidWithParameter

extends JetVisitor { return null; } + @Override + public Void visitPrimaryConstructor(@NotNull JetPrimaryConstructor constructor, P data) { + visitPrimaryConstructorVoid(constructor, data); + return null; + } + @Override public final Void visitNamedFunction(@NotNull JetNamedFunction function, P data) { visitNamedFunctionVoid(function, data); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/elements/JetStubElementTypes.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/elements/JetStubElementTypes.java index dcaa78d6ddc..2517067e101 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/elements/JetStubElementTypes.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/elements/JetStubElementTypes.java @@ -35,6 +35,8 @@ public interface JetStubElementTypes { new JetPlaceHolderStubElementType("ANONYMOUS_INITIALIZER", JetClassInitializer.class); JetPlaceHolderStubElementType SECONDARY_CONSTRUCTOR = new JetPlaceHolderStubElementType("SECONDARY_CONSTRUCTOR", JetSecondaryConstructor.class); + JetPlaceHolderStubElementType PRIMARY_CONSTRUCTOR = + new JetPlaceHolderStubElementType("PRIMARY_CONSTRUCTOR", JetPrimaryConstructor.class); JetParameterElementType VALUE_PARAMETER = new JetParameterElementType("VALUE_PARAMETER"); JetPlaceHolderStubElementType VALUE_PARAMETER_LIST = @@ -65,9 +67,6 @@ public interface JetStubElementTypes { JetModifierListElementType MODIFIER_LIST = new JetModifierListElementType("MODIFIER_LIST", JetDeclarationModifierList.class); - JetModifierListElementType PRIMARY_CONSTRUCTOR_MODIFIER_LIST = - new JetModifierListElementType("PRIMARY_CONSTRUCTOR_MODIFIER_LIST", JetPrimaryConstructorModifierList.class); - JetPlaceHolderStubElementType TYPE_CONSTRAINT_LIST = new JetPlaceHolderStubElementType("TYPE_CONSTRAINT_LIST", JetTypeConstraintList.class); diff --git a/compiler/testData/psi/BabySteps.txt b/compiler/testData/psi/BabySteps.txt index 0bf31c8fd1f..99a0ce249c3 100644 --- a/compiler/testData/psi/BabySteps.txt +++ b/compiler/testData/psi/BabySteps.txt @@ -17,23 +17,24 @@ JetFile: BabySteps.kt TYPE_PARAMETER PsiElement(IDENTIFIER)('a') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('doo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('0') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('doo') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/BabySteps_ERR.txt b/compiler/testData/psi/BabySteps_ERR.txt index 4645fa393ce..984052227d8 100644 --- a/compiler/testData/psi/BabySteps_ERR.txt +++ b/compiler/testData/psi/BabySteps_ERR.txt @@ -17,23 +17,24 @@ JetFile: BabySteps_ERR.kt TYPE_PARAMETER PsiElement(IDENTIFIER)('a') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('doo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('0') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('doo') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/Constructors.txt b/compiler/testData/psi/Constructors.txt index c85e0adfd1a..ae4ac981fbc 100644 --- a/compiler/testData/psi/Constructors.txt +++ b/compiler/testData/psi/Constructors.txt @@ -18,9 +18,10 @@ JetFile: Constructors.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -39,12 +40,13 @@ JetFile: Constructors.kt PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') PsiWhiteSpace(' ') - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -67,9 +69,10 @@ JetFile: Constructors.kt TYPE_PARAMETER PsiElement(IDENTIFIER)('T') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -93,12 +96,13 @@ JetFile: Constructors.kt PsiElement(IDENTIFIER)('T') PsiElement(GT)('>') PsiWhiteSpace(' ') - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/DocCommentsBinding.txt b/compiler/testData/psi/DocCommentsBinding.txt index 12f113f54b4..76dad1cd8bd 100644 --- a/compiler/testData/psi/DocCommentsBinding.txt +++ b/compiler/testData/psi/DocCommentsBinding.txt @@ -16,31 +16,32 @@ JetFile: DocCommentsBinding.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('A') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - KDoc - PsiElement(KDOC_START)('/**') - PsiWhiteSpace('\n ') - KDOC_SECTION - PsiElement(KDOC_LEADING_ASTERISK)('*') - PsiElement(KDOC_TEXT)(' Doc comment for val-parameter') - PsiWhiteSpace('\n ') - PsiElement(KDOC_END)('*/') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') PsiWhiteSpace('\n ') - PsiComment(BLOCK_COMMENT)('/*var*/') - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('p') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace('\n') - PsiElement(RPAR)(')') + VALUE_PARAMETER + KDoc + PsiElement(KDOC_START)('/**') + PsiWhiteSpace('\n ') + KDOC_SECTION + PsiElement(KDOC_LEADING_ASTERISK)('*') + PsiElement(KDOC_TEXT)(' Doc comment for val-parameter') + PsiWhiteSpace('\n ') + PsiElement(KDOC_END)('*/') + PsiWhiteSpace('\n ') + PsiComment(BLOCK_COMMENT)('/*var*/') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('p') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace('\n') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/DynamicSoftKeyword.txt b/compiler/testData/psi/DynamicSoftKeyword.txt index a8eb19f46cb..007a5d70f9e 100644 --- a/compiler/testData/psi/DynamicSoftKeyword.txt +++ b/compiler/testData/psi/DynamicSoftKeyword.txt @@ -18,16 +18,17 @@ JetFile: DynamicSoftKeyword.kt TYPE_PARAMETER PsiElement(IDENTIFIER)('dynamic') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('dynamic') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - DYNAMIC_TYPE - PsiElement(dynamic)('dynamic') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('dynamic') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + DYNAMIC_TYPE + PsiElement(dynamic)('dynamic') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/Enums.txt b/compiler/testData/psi/Enums.txt index c3ae749f6f3..51b6d33efad 100644 --- a/compiler/testData/psi/Enums.txt +++ b/compiler/testData/psi/Enums.txt @@ -8,20 +8,21 @@ JetFile: Enums.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Color') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('rgb') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('rgb') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/ParameterType.txt b/compiler/testData/psi/ParameterType.txt index 6244595cfcc..739f748ae1a 100644 --- a/compiler/testData/psi/ParameterType.txt +++ b/compiler/testData/psi/ParameterType.txt @@ -270,14 +270,15 @@ JetFile: ParameterType.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('A') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') \ No newline at end of file + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/ParameterType_ERR.txt b/compiler/testData/psi/ParameterType_ERR.txt index de172ad2ff6..42c0a87f6f5 100644 --- a/compiler/testData/psi/ParameterType_ERR.txt +++ b/compiler/testData/psi/ParameterType_ERR.txt @@ -200,24 +200,26 @@ JetFile: ParameterType_ERR.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('A') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiErrorElement:Parameters must have type annotation - - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Parameters must have type annotation + + PsiElement(RPAR)(')') PsiWhiteSpace('\n') CLASS PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('A') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(RPAR)(')') \ No newline at end of file + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + TYPE_REFERENCE + PsiErrorElement:Type expected + + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/PrimaryConstructorModifiers_ERR.txt b/compiler/testData/psi/PrimaryConstructorModifiers_ERR.txt index fb7cb081c85..d626f3c5cd4 100644 --- a/compiler/testData/psi/PrimaryConstructorModifiers_ERR.txt +++ b/compiler/testData/psi/PrimaryConstructorModifiers_ERR.txt @@ -17,8 +17,9 @@ JetFile: PrimaryConstructorModifiers_ERR.kt PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('AB') PsiWhiteSpace(' ') - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') PsiErrorElement:Expecting primary constructor parameter list PsiWhiteSpace(' ') @@ -69,12 +70,13 @@ JetFile: PrimaryConstructorModifiers_ERR.kt PsiElement(IDENTIFIER)('A') PsiElement(GT)('>') PsiWhiteSpace(' ') - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/PropertiesFollowedByInitializers.txt b/compiler/testData/psi/PropertiesFollowedByInitializers.txt index 40ad2f2989a..8f78ca1da87 100644 --- a/compiler/testData/psi/PropertiesFollowedByInitializers.txt +++ b/compiler/testData/psi/PropertiesFollowedByInitializers.txt @@ -5,9 +5,10 @@ JetFile: PropertiesFollowedByInitializers.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -264,9 +265,10 @@ JetFile: PropertiesFollowedByInitializers.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('PublicVar') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -291,9 +293,10 @@ JetFile: PropertiesFollowedByInitializers.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('PublicVar') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -330,9 +333,10 @@ JetFile: PropertiesFollowedByInitializers.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('PublicVar') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -356,9 +360,10 @@ JetFile: PropertiesFollowedByInitializers.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('PublicVar') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -383,9 +388,10 @@ JetFile: PropertiesFollowedByInitializers.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('PublicVar') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/SoftKeywords.txt b/compiler/testData/psi/SoftKeywords.txt index 6c9fa68b99c..9a8f32e1a1e 100644 --- a/compiler/testData/psi/SoftKeywords.txt +++ b/compiler/testData/psi/SoftKeywords.txt @@ -133,18 +133,19 @@ JetFile: SoftKeywords.kt PsiWhiteSpace('\n ') PsiElement(GT)('>') PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -1004,318 +1005,319 @@ JetFile: SoftKeywords.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('F') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('abstract') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('open') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('enum') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('open') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('annotation') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('override') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('open') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('abstract') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('private') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('protected') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('public') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('internal') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('lazy') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('wraps') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('import') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('where') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('by') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('get') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('set') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('public') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('private') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('protected') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('internal') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('t') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - MODIFIER_LIST - PsiElement(public)('public') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(protected)('protected') + PsiElement(IDENTIFIER)('foo') PsiWhiteSpace(' ') - PsiElement(private)('private') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(internal)('internal') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('abstract') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - PsiElement(abstract)('abstract') - PsiWhiteSpace('\n ') - PsiElement(open)('open') - PsiWhiteSpace('\n ') - PsiElement(enum)('enum') - PsiWhiteSpace('\n ') - PsiElement(open)('open') - PsiWhiteSpace('\n ') - PsiElement(annotation)('annotation') - PsiWhiteSpace('\n ') - PsiElement(override)('override') - PsiWhiteSpace('\n ') - PsiElement(open)('open') - PsiWhiteSpace('\n ') - PsiElement(abstract)('abstract') - PsiWhiteSpace('\n ') - PsiElement(private)('private') - PsiWhiteSpace('\n ') - PsiElement(protected)('protected') - PsiWhiteSpace('\n ') - PsiElement(public)('public') - PsiWhiteSpace('\n ') - PsiElement(internal)('internal') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('open') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace('\n') - PsiElement(RPAR)(')') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('open') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('enum') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('open') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('annotation') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('override') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('open') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('abstract') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('private') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('protected') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('public') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('internal') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('lazy') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('wraps') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('import') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('where') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('by') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('get') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('set') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('public') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('private') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('protected') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('internal') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiElement(COMMA)(',') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(public)('public') + PsiWhiteSpace(' ') + PsiElement(protected)('protected') + PsiWhiteSpace(' ') + PsiElement(private)('private') + PsiWhiteSpace(' ') + PsiElement(internal)('internal') + PsiWhiteSpace(' ') + PsiElement(abstract)('abstract') + PsiWhiteSpace('\n ') + PsiElement(open)('open') + PsiWhiteSpace('\n ') + PsiElement(enum)('enum') + PsiWhiteSpace('\n ') + PsiElement(open)('open') + PsiWhiteSpace('\n ') + PsiElement(annotation)('annotation') + PsiWhiteSpace('\n ') + PsiElement(override)('override') + PsiWhiteSpace('\n ') + PsiElement(open)('open') + PsiWhiteSpace('\n ') + PsiElement(abstract)('abstract') + PsiWhiteSpace('\n ') + PsiElement(private)('private') + PsiWhiteSpace('\n ') + PsiElement(protected)('protected') + PsiWhiteSpace('\n ') + PsiElement(public)('public') + PsiWhiteSpace('\n ') + PsiElement(internal)('internal') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('open') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace('\n') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/ThisType.txt b/compiler/testData/psi/ThisType.txt index dac72f5be76..29f3b9456ec 100644 --- a/compiler/testData/psi/ThisType.txt +++ b/compiler/testData/psi/ThisType.txt @@ -24,35 +24,36 @@ JetFile: ThisType.kt PsiElement(This)('This') PsiElement(GT)('>') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + SELF_TYPE + PsiElement(This)('This') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - SELF_TYPE - PsiElement(This)('This') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - SELF_TYPE - PsiElement(This)('This') - PsiElement(GT)('>') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + SELF_TYPE + PsiElement(This)('This') + PsiElement(GT)('>') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/TraitConstructor.txt b/compiler/testData/psi/TraitConstructor.txt index c820aef5628..de7b7ae4b39 100644 --- a/compiler/testData/psi/TraitConstructor.txt +++ b/compiler/testData/psi/TraitConstructor.txt @@ -5,46 +5,48 @@ JetFile: TraitConstructor.kt PsiElement(trait)('trait') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('TestTrait') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + VALUE_PARAMETER + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(var)('var') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('c') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Double') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Double') + PsiElement(RPAR)(')') PsiWhiteSpace('\n') CLASS PsiElement(trait)('trait') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('TestTrait') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') \ No newline at end of file + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/annotation/TypeAnnotations.txt b/compiler/testData/psi/annotation/TypeAnnotations.txt index a609784a3a5..0fa10279233 100644 --- a/compiler/testData/psi/annotation/TypeAnnotations.txt +++ b/compiler/testData/psi/annotation/TypeAnnotations.txt @@ -5,38 +5,39 @@ JetFile: TypeAnnotations.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('F') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(RBRACKET)(']') + PsiElement(COLON)(':') PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') + TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') TYPEDEF PsiElement(typealias)('typealias') diff --git a/compiler/testData/psi/examples/BinaryTree.txt b/compiler/testData/psi/examples/BinaryTree.txt index 0d2b4b8c79d..867df7082cd 100644 --- a/compiler/testData/psi/examples/BinaryTree.txt +++ b/compiler/testData/psi/examples/BinaryTree.txt @@ -38,35 +38,36 @@ JetFile: BinaryTree.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('TreeNode') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(var)('var') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiWhiteSpace('\n ') + VALUE_PARAMETER + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('value') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(var)('var') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('parent') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('TreeNode') - PsiWhiteSpace('\n ') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('parent') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('TreeNode') + PsiWhiteSpace('\n ') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/examples/Color.txt b/compiler/testData/psi/examples/Color.txt index 5ecddf8d79b..d28c4709d2a 100644 --- a/compiler/testData/psi/examples/Color.txt +++ b/compiler/testData/psi/examples/Color.txt @@ -8,46 +8,47 @@ JetFile: Color.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Color') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('r') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('r') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('g') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('g') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('sb') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('sb') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/examples/Graph.txt b/compiler/testData/psi/examples/Graph.txt index 018a70821da..5f7b6c10cfb 100644 --- a/compiler/testData/psi/examples/Graph.txt +++ b/compiler/testData/psi/examples/Graph.txt @@ -10,20 +10,21 @@ JetFile: Graph.kt TYPE_PARAMETER PsiElement(IDENTIFIER)('V') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('data') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('V') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('data') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('V') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') CLASS PsiElement(class)('class') @@ -38,46 +39,47 @@ JetFile: Graph.kt TYPE_PARAMETER PsiElement(IDENTIFIER)('E') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('from') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('V') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('from') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('data') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('E') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('V') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('data') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('to') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('V') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('to') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('V') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/Queue.txt b/compiler/testData/psi/examples/Queue.txt index 17f0c673295..d6f3baee73b 100644 --- a/compiler/testData/psi/examples/Queue.txt +++ b/compiler/testData/psi/examples/Queue.txt @@ -43,41 +43,42 @@ JetFile: Queue.kt TYPE_PARAMETER PsiElement(IDENTIFIER)('T') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('data') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('data') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(var)('var') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('next') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Item') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('next') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Item') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(GT)('>') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n ') PROPERTY MODIFIER_LIST diff --git a/compiler/testData/psi/examples/UpdateOperation.txt b/compiler/testData/psi/examples/UpdateOperation.txt index 8e3928b7a64..375e94dbdec 100644 --- a/compiler/testData/psi/examples/UpdateOperation.txt +++ b/compiler/testData/psi/examples/UpdateOperation.txt @@ -5,29 +5,30 @@ JetFile: UpdateOperation.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Pair') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/examples/collections/HashMap.txt b/compiler/testData/psi/examples/collections/HashMap.txt index 29604e8fe9f..c9c77b662eb 100644 --- a/compiler/testData/psi/examples/collections/HashMap.txt +++ b/compiler/testData/psi/examples/collections/HashMap.txt @@ -298,20 +298,21 @@ JetFile: HashMap.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('HashableWrapper') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('obj') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Any') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('obj') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Any') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -881,26 +882,27 @@ JetFile: HashMap.kt TYPE_PARAMETER PsiElement(IDENTIFIER)('V') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('hashingStrategy') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('IHashingStrategy') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('K') - PsiElement(GT)('>') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('hashingStrategy') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('IHashingStrategy') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('K') + PsiElement(GT)('>') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/examples/collections/LinkedList.txt b/compiler/testData/psi/examples/collections/LinkedList.txt index 3980bf250c8..8c8508c8629 100644 --- a/compiler/testData/psi/examples/collections/LinkedList.txt +++ b/compiler/testData/psi/examples/collections/LinkedList.txt @@ -38,20 +38,21 @@ JetFile: LinkedList.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Item') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(var)('var') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('value') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Item') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('value') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Item') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/examples/io/IOSamples.txt b/compiler/testData/psi/examples/io/IOSamples.txt index 26ebeec9599..88cd9f02d04 100644 --- a/compiler/testData/psi/examples/io/IOSamples.txt +++ b/compiler/testData/psi/examples/io/IOSamples.txt @@ -74,26 +74,27 @@ JetFile: IOSamples.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('JavaCloseableWrapper') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('closeable') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('closeable') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE USER_TYPE USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('java') + PsiElement(DOT)('.') REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('java') + PsiElement(IDENTIFIER)('io') PsiElement(DOT)('.') REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('io') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Closeable') - PsiElement(RPAR)(')') + PsiElement(IDENTIFIER)('Closeable') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt b/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt index b765cf5b3c9..5967db38171 100644 --- a/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt +++ b/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt @@ -10,26 +10,27 @@ JetFile: PriorityQueueAsPushPop.kt TYPE_PARAMETER PsiElement(IDENTIFIER)('T') PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('wrapped') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('IPriorityQueue') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(GT)('>') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('wrapped') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('IPriorityQueue') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(GT)('>') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/greatSyntacticShift/functionTypes.txt b/compiler/testData/psi/greatSyntacticShift/functionTypes.txt index 15cfc794dca..e0a3938fc8c 100644 --- a/compiler/testData/psi/greatSyntacticShift/functionTypes.txt +++ b/compiler/testData/psi/greatSyntacticShift/functionTypes.txt @@ -40,9 +40,10 @@ JetFile: functionTypes.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('XXX') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -694,9 +695,10 @@ JetFile: functionTypes.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('YYY') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/recovery/MissingCommaInConstructorValueParameterList.txt b/compiler/testData/psi/recovery/MissingCommaInConstructorValueParameterList.txt index 15b3bae7bec..47fae2c1510 100644 --- a/compiler/testData/psi/recovery/MissingCommaInConstructorValueParameterList.txt +++ b/compiler/testData/psi/recovery/MissingCommaInConstructorValueParameterList.txt @@ -5,49 +5,50 @@ JetFile: MissingCommaInConstructorValueParameterList.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Test') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - MODIFIER_LIST - PsiElement(private)('private') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiErrorElement:Expecting comma or ')' + PsiWhiteSpace(' ') - PsiElement(val)('val') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiErrorElement:Expecting comma or ')' + PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiErrorElement:Expecting comma or ')' - - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiErrorElement:Expecting comma or ')' - - PsiWhiteSpace(' ') - VALUE_PARAMETER - MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('c') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + VALUE_PARAMETER + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/recovery/MissingCommaInValueParameterListWithValOrVar.txt b/compiler/testData/psi/recovery/MissingCommaInValueParameterListWithValOrVar.txt index b08e7eb15f0..0fbe5ee1256 100644 --- a/compiler/testData/psi/recovery/MissingCommaInValueParameterListWithValOrVar.txt +++ b/compiler/testData/psi/recovery/MissingCommaInValueParameterListWithValOrVar.txt @@ -5,45 +5,46 @@ JetFile: MissingCommaInValueParameterListWithValOrVar.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Test') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiErrorElement:Expecting comma or ')' + PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + VALUE_PARAMETER + PsiElement(var)('var') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiErrorElement:Expecting comma or ')' + PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiErrorElement:Expecting comma or ')' - - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(var)('var') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiErrorElement:Expecting comma or ')' - - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('c') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/recovery/ValueParameterNoTypeRecovery.txt b/compiler/testData/psi/recovery/ValueParameterNoTypeRecovery.txt index edc285eefe6..50ce700c900 100644 --- a/compiler/testData/psi/recovery/ValueParameterNoTypeRecovery.txt +++ b/compiler/testData/psi/recovery/ValueParameterNoTypeRecovery.txt @@ -5,35 +5,36 @@ JetFile: ValueParameterNoTypeRecovery.kt PsiElement(class)('class') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Test') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(val)('val') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('a') + PsiErrorElement:Parameters must have type annotation + + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('12') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('a') - PsiErrorElement:Parameters must have type annotation - - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('12') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('13') - PsiElement(RPAR)(')') \ No newline at end of file + VALUE_PARAMETER + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('13') + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt b/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt index d1c27aa3b24..cd00be79eab 100644 --- a/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt +++ b/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt @@ -8,12 +8,13 @@ JetFile: ConstructorModifiers.kt PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') OBJECT_DECLARATION PsiElement(object)('object') @@ -22,12 +23,13 @@ JetFile: ConstructorModifiers.kt PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -40,12 +42,13 @@ JetFile: ConstructorModifiers.kt PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -68,32 +71,33 @@ JetFile: ConstructorModifiers.kt PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(private)('private') + PsiWhiteSpace(' ') + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - PsiElement(private)('private') - PsiWhiteSpace(' ') - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') \ No newline at end of file + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt b/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt index 9c191b0c655..7d4e4e968dd 100644 --- a/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt +++ b/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt @@ -7,9 +7,10 @@ JetFile: EmptyParentheses.kt OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') OBJECT_DECLARATION PsiElement(object)('object') @@ -17,9 +18,10 @@ JetFile: EmptyParentheses.kt OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -31,9 +33,10 @@ JetFile: EmptyParentheses.kt OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/recovery/objects/declarations/Everything.txt b/compiler/testData/psi/recovery/objects/declarations/Everything.txt index cdf5176d9d3..5e25cea150e 100644 --- a/compiler/testData/psi/recovery/objects/declarations/Everything.txt +++ b/compiler/testData/psi/recovery/objects/declarations/Everything.txt @@ -18,30 +18,31 @@ JetFile: Everything.kt PsiElement(GT)('>') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(COLON)(':') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt b/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt index 983b9af1600..35311124f43 100644 --- a/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt +++ b/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt @@ -7,27 +7,28 @@ JetFile: ParametersInParentheses.kt OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') OBJECT_DECLARATION PsiElement(object)('object') @@ -35,27 +36,28 @@ JetFile: ParametersInParentheses.kt OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -67,27 +69,28 @@ JetFile: ParametersInParentheses.kt OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt b/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt index 95c60476c3f..41c02129de2 100644 --- a/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt +++ b/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt @@ -17,9 +17,10 @@ JetFile: TypeParametersAndParentheses.kt PsiElement(IDENTIFIER)('R') PsiElement(GT)('>') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') OBJECT_DECLARATION PsiElement(object)('object') @@ -37,17 +38,18 @@ JetFile: TypeParametersAndParentheses.kt PsiElement(IDENTIFIER)('R') PsiElement(GT)('>') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -69,9 +71,10 @@ JetFile: TypeParametersAndParentheses.kt PsiElement(IDENTIFIER)('R') PsiElement(GT)('>') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/recovery/objects/declarations/Where.txt b/compiler/testData/psi/recovery/objects/declarations/Where.txt index 3dca30b43c9..2f465e7471c 100644 --- a/compiler/testData/psi/recovery/objects/declarations/Where.txt +++ b/compiler/testData/psi/recovery/objects/declarations/Where.txt @@ -60,9 +60,10 @@ JetFile: Where.kt OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiErrorElement:Where clause is not allowed for objects PsiErrorElement:Type constraints are not allowed when no type parameters declared @@ -86,9 +87,10 @@ JetFile: Where.kt OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -121,9 +123,10 @@ JetFile: Where.kt OBJECT_DECLARATION_NAME PsiElement(IDENTIFIER)('Foo') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt index 8dc0264bb21..a39fe6f500c 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt +++ b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt @@ -16,9 +16,10 @@ JetFile: ConstructorModifiers.kt PsiElement(IDENTIFIER)('private') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -39,9 +40,10 @@ JetFile: ConstructorModifiers.kt PsiElement(IDENTIFIER)('private') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -69,35 +71,36 @@ JetFile: ConstructorModifiers.kt PsiElement(object)('object') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(private)('private') + PsiWhiteSpace(' ') + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - PsiElement(private)('private') - PsiWhiteSpace(' ') - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -118,9 +121,10 @@ JetFile: ConstructorModifiers.kt PsiElement(IDENTIFIER)('private') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') CLASS_BODY PsiErrorElement:Expecting a class body \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt index 1710d98a846..2a85d318791 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt +++ b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt @@ -16,12 +16,13 @@ JetFile: ConstructorModifiersAndName.kt PsiElement(IDENTIFIER)('Name') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -42,12 +43,13 @@ JetFile: ConstructorModifiersAndName.kt PsiElement(IDENTIFIER)('Name') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -78,35 +80,36 @@ JetFile: ConstructorModifiersAndName.kt PsiElement(IDENTIFIER)('Name') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(private)('private') + PsiWhiteSpace(' ') + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - PsiElement(private)('private') - PsiWhiteSpace(' ') - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -127,12 +130,13 @@ JetFile: ConstructorModifiersAndName.kt PsiElement(IDENTIFIER)('Name') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') + PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') CLASS_BODY PsiErrorElement:Expecting a class body \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/expressions/EmptyParentheses.txt b/compiler/testData/psi/recovery/objects/expressions/EmptyParentheses.txt index d3c5d500b32..9c456b3657d 100644 --- a/compiler/testData/psi/recovery/objects/expressions/EmptyParentheses.txt +++ b/compiler/testData/psi/recovery/objects/expressions/EmptyParentheses.txt @@ -12,9 +12,10 @@ JetFile: EmptyParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -31,9 +32,10 @@ JetFile: EmptyParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -60,9 +62,10 @@ JetFile: EmptyParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') CLASS_BODY PsiErrorElement:Expecting a class body \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/expressions/Everything.txt b/compiler/testData/psi/recovery/objects/expressions/Everything.txt index f660ca8768b..3229281fa58 100644 --- a/compiler/testData/psi/recovery/objects/expressions/Everything.txt +++ b/compiler/testData/psi/recovery/objects/expressions/Everything.txt @@ -23,30 +23,31 @@ JetFile: Everything.kt PsiElement(GT)('>') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - PsiElement(private)('private') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + PsiElement(private)('private') PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(COLON)(':') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/recovery/objects/expressions/InFunction.txt b/compiler/testData/psi/recovery/objects/expressions/InFunction.txt index ad92fff1037..938c64d2472 100644 --- a/compiler/testData/psi/recovery/objects/expressions/InFunction.txt +++ b/compiler/testData/psi/recovery/objects/expressions/InFunction.txt @@ -27,9 +27,10 @@ JetFile: InFunction.kt PsiElement(IDENTIFIER)('private') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n ') CLASS_BODY PsiErrorElement:Expecting a class body @@ -49,9 +50,10 @@ JetFile: InFunction.kt PsiElement(IDENTIFIER)('private') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -77,35 +79,36 @@ JetFile: InFunction.kt PsiElement(object)('object') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - PRIMARY_CONSTRUCTOR_MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') + PRIMARY_CONSTRUCTOR + MODIFIER_LIST + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(private)('private') + PsiWhiteSpace(' ') + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('bar') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - PsiElement(private)('private') - PsiWhiteSpace(' ') - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n ') CLASS_BODY PsiErrorElement:Expecting a class body @@ -125,9 +128,10 @@ JetFile: InFunction.kt PsiElement(IDENTIFIER)('private') PsiWhiteSpace(' ') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n') CLASS_BODY PsiErrorElement:Expecting a class body diff --git a/compiler/testData/psi/recovery/objects/expressions/ParametersInParentheses.txt b/compiler/testData/psi/recovery/objects/expressions/ParametersInParentheses.txt index 8172bf32b7f..3211da093e0 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ParametersInParentheses.txt +++ b/compiler/testData/psi/recovery/objects/expressions/ParametersInParentheses.txt @@ -12,27 +12,28 @@ JetFile: ParametersInParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -49,27 +50,28 @@ JetFile: ParametersInParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -96,27 +98,28 @@ JetFile: ParametersInParentheses.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(RPAR)(')') CLASS_BODY PsiErrorElement:Expecting a class body \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/expressions/TypeParametersAndParentheses.txt b/compiler/testData/psi/recovery/objects/expressions/TypeParametersAndParentheses.txt index 5cb977443d8..723f4f00be6 100644 --- a/compiler/testData/psi/recovery/objects/expressions/TypeParametersAndParentheses.txt +++ b/compiler/testData/psi/recovery/objects/expressions/TypeParametersAndParentheses.txt @@ -22,17 +22,18 @@ JetFile: TypeParametersAndParentheses.kt PsiElement(IDENTIFIER)('R') PsiElement(GT)('>') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') CLASS_BODY PsiElement(LBRACE)('{') @@ -59,9 +60,10 @@ JetFile: TypeParametersAndParentheses.kt PsiElement(IDENTIFIER)('R') PsiElement(GT)('>') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -98,9 +100,10 @@ JetFile: TypeParametersAndParentheses.kt PsiElement(IDENTIFIER)('R') PsiElement(GT)('>') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') CLASS_BODY PsiErrorElement:Expecting a class body \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/expressions/TypeParameterss.txt b/compiler/testData/psi/recovery/objects/expressions/TypeParameterss.txt index 62c4bf4f123..80da6564bb2 100644 --- a/compiler/testData/psi/recovery/objects/expressions/TypeParameterss.txt +++ b/compiler/testData/psi/recovery/objects/expressions/TypeParameterss.txt @@ -72,27 +72,28 @@ JetFile: TypeParameterss.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(COLON)(':') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(RPAR)(')') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('b') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('String') + PsiElement(RPAR)(')') CLASS_BODY PsiErrorElement:Expecting a class body \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/expressions/Where.txt b/compiler/testData/psi/recovery/objects/expressions/Where.txt index 9aba56f525d..f9f75e69899 100644 --- a/compiler/testData/psi/recovery/objects/expressions/Where.txt +++ b/compiler/testData/psi/recovery/objects/expressions/Where.txt @@ -86,9 +86,10 @@ JetFile: Where.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiErrorElement:Where clause is not allowed for objects PsiErrorElement:Type constraints are not allowed when no type parameters declared @@ -121,9 +122,10 @@ JetFile: Where.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -165,9 +167,10 @@ JetFile: Where.kt OBJECT_DECLARATION PsiElement(object)('object') PsiErrorElement:Constructors are not allowed for objects - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PRIMARY_CONSTRUCTOR + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ')