diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java index 4982fa5590f..38a9b6700d4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java @@ -882,13 +882,9 @@ public class JetParsing extends AbstractJetParsing { */ private IElementType parseClassObject() { assert _at(CLASS_KEYWORD) && lookahead(1) == OBJECT_KEYWORD; - advance(); // CLASS_KEYWORD - - PsiBuilder.Marker objectDeclaration = mark(); parseObject(NameParsingMode.ALLOWED, true); - closeDeclarationWithCommentBinders(objectDeclaration, OBJECT_DECLARATION, true); - return CLASS_OBJECT; + return OBJECT_DECLARATION; } /* diff --git a/compiler/testData/psi/ByClauses.txt b/compiler/testData/psi/ByClauses.txt index d451342650d..f0878551e30 100644 --- a/compiler/testData/psi/ByClauses.txt +++ b/compiler/testData/psi/ByClauses.txt @@ -23,15 +23,14 @@ JetFile: ByClauses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') @@ -75,15 +74,14 @@ JetFile: ByClauses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') @@ -112,15 +110,14 @@ JetFile: ByClauses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') @@ -158,15 +155,14 @@ JetFile: ByClauses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') @@ -207,15 +203,14 @@ JetFile: ByClauses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') @@ -257,15 +252,14 @@ JetFile: ByClauses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') @@ -319,14 +313,13 @@ JetFile: ByClauses.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/CommentsBinding.txt b/compiler/testData/psi/CommentsBinding.txt index 1cf194fbc68..01942c4d6b7 100644 --- a/compiler/testData/psi/CommentsBinding.txt +++ b/compiler/testData/psi/CommentsBinding.txt @@ -263,20 +263,19 @@ JetFile: CommentsBinding.kt PsiWhiteSpace(' ') PsiComment(EOL_COMMENT)('// end of foo') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiComment(EOL_COMMENT)('// class object') PsiWhiteSpace('\n ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') - PsiWhiteSpace(' ') - PsiComment(EOL_COMMENT)('// end of class object') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace(' ') + PsiComment(EOL_COMMENT)('// end of class object') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') diff --git a/compiler/testData/psi/NamedClassObject.txt b/compiler/testData/psi/NamedClassObject.txt index 8e1dcd4ccb1..af921635c93 100644 --- a/compiler/testData/psi/NamedClassObject.txt +++ b/compiler/testData/psi/NamedClassObject.txt @@ -9,42 +9,38 @@ JetFile: NamedClassObject.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('Default') + PsiElement(object)('object') + PsiWhiteSpace(' ') + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('Default') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('B') + PsiElement(object)('object') + PsiWhiteSpace(' ') + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('B') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - OBJECT_DECLARATION_NAME - PsiElement(IDENTIFIER)('C') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + OBJECT_DECLARATION_NAME + PsiElement(IDENTIFIER)('C') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') + PsiElement(object)('object') PsiWhiteSpace('\n\n ') OBJECT_DECLARATION PsiElement(object)('object') diff --git a/compiler/testData/psi/SimpleClassMembers.txt b/compiler/testData/psi/SimpleClassMembers.txt index 22122f0364b..48feec4e33f 100644 --- a/compiler/testData/psi/SimpleClassMembers.txt +++ b/compiler/testData/psi/SimpleClassMembers.txt @@ -86,129 +86,124 @@ JetFile: SimpleClassMembers.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Fooo') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + DELEGATION_SPECIFIER_LIST + DELEGATOR_SUPER_CLASS + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Fooo') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + DELEGATION_SPECIFIER_LIST + DELEGATOR_SUPER_CLASS + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Fooo') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Fooo') - PsiElement(COMMA)(',') + DELEGATOR_BY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') PsiWhiteSpace(' ') - DELEGATOR_BY - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiWhiteSpace(' ') - PsiElement(by)('by') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + PsiElement(by)('by') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + DELEGATION_SPECIFIER_LIST + DELEGATOR_SUPER_CLASS + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Fooo') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + DELEGATOR_BY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiWhiteSpace(' ') + PsiElement(by)('by') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + DELEGATOR_SUPER_CALL + CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Fooo') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - DELEGATOR_BY - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiWhiteSpace(' ') - PsiElement(by)('by') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Goo') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PsiElement(IDENTIFIER)('Goo') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') @@ -283,128 +278,123 @@ JetFile: SimpleClassMembers.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('bar') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Fooo') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + DELEGATION_SPECIFIER_LIST + DELEGATOR_SUPER_CLASS + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Fooo') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + DELEGATION_SPECIFIER_LIST + DELEGATOR_SUPER_CLASS + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Fooo') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Fooo') - PsiElement(COMMA)(',') + DELEGATOR_BY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') PsiWhiteSpace(' ') - DELEGATOR_BY - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiWhiteSpace(' ') - PsiElement(by)('by') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + PsiElement(by)('by') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + DELEGATION_SPECIFIER_LIST + DELEGATOR_SUPER_CLASS + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Fooo') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + DELEGATOR_BY + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiWhiteSpace(' ') + PsiElement(by)('by') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('foo') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + DELEGATOR_SUPER_CALL + CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Fooo') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - DELEGATOR_BY - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiWhiteSpace(' ') - PsiElement(by)('by') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - DELEGATOR_SUPER_CALL - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Goo') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PsiElement(IDENTIFIER)('Goo') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n\n\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/annotation/ShortAnnotations.txt b/compiler/testData/psi/annotation/ShortAnnotations.txt index 154e4a5858d..c5c38b47136 100644 --- a/compiler/testData/psi/annotation/ShortAnnotations.txt +++ b/compiler/testData/psi/annotation/ShortAnnotations.txt @@ -425,7 +425,7 @@ JetFile: ShortAnnotations.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION MODIFIER_LIST ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -477,12 +477,11 @@ JetFile: ShortAnnotations.kt PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/PolymorphicClassObjects.txt b/compiler/testData/psi/examples/PolymorphicClassObjects.txt index ff6acf9640e..74699f006b3 100644 --- a/compiler/testData/psi/examples/PolymorphicClassObjects.txt +++ b/compiler/testData/psi/examples/PolymorphicClassObjects.txt @@ -131,67 +131,66 @@ JetFile: PolymorphicClassObjects.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Buildable') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - FUN - MODIFIER_LIST - PsiElement(override)('override') + PsiElement(object)('object') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + DELEGATION_SPECIFIER_LIST + DELEGATOR_SUPER_CLASS + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Buildable') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FUN + MODIFIER_LIST + PsiElement(override)('override') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('newBuilder') + TYPE_PARAMETER_LIST + PsiElement(LT)('<') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('E') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('newBuilder') - TYPE_PARAMETER_LIST - PsiElement(LT)('<') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('E') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PARAMETER - PsiElement(IDENTIFIER)('R') - PsiElement(GT)('>') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Builder') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('R') - PsiElement(GT)('>') - PsiWhiteSpace('\n\n ') - PsiElement(RBRACE)('}') + TYPE_PARAMETER + PsiElement(IDENTIFIER)('R') + PsiElement(GT)('>') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Builder') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('E') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('R') + PsiElement(GT)('>') + PsiWhiteSpace('\n\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') diff --git a/compiler/testData/psi/examples/UpdateOperation.txt b/compiler/testData/psi/examples/UpdateOperation.txt index 23744373ef8..05630e6f3a8 100644 --- a/compiler/testData/psi/examples/UpdateOperation.txt +++ b/compiler/testData/psi/examples/UpdateOperation.txt @@ -32,90 +32,89 @@ JetFile: UpdateOperation.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - FUN - PsiElement(fun)('fun') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('copy') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('from') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Pair') + PsiElement(COMMA)(',') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('copy') - VALUE_PARAMETER_LIST + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('from') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('y') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('from') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Pair') + VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('from') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Pair') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('from') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('from') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('y') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('y') PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Pair') - VALUE_ARGUMENT_LIST - PsiElement(LPAR)('(') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') diff --git a/compiler/testData/psi/recovery/kt2172.txt b/compiler/testData/psi/recovery/kt2172.txt index 1be9fc091a2..c2f6e82c5c9 100644 --- a/compiler/testData/psi/recovery/kt2172.txt +++ b/compiler/testData/psi/recovery/kt2172.txt @@ -9,20 +9,19 @@ JetFile: kt2172.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n ') - CLASS_OBJECT + OBJECT_DECLARATION PsiElement(class)('class') PsiWhiteSpace(' ') - OBJECT_DECLARATION - PsiElement(object)('object') - PsiWhiteSpace(' ') - CLASS_BODY - PsiElement(LBRACE)('{') - PsiWhiteSpace('\n ') - PROPERTY - PsiElement(val)('val') - PsiErrorElement:Expecting property name or receiver type - - PsiWhiteSpace('\n ') - PsiElement(RBRACE)('}') + PsiElement(object)('object') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PROPERTY + PsiElement(val)('val') + PsiErrorElement:Expecting property name or receiver type + + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file