Removed all places in parser where obsolete annotation syntax was allowed

This commit is contained in:
Valentin Kipyatkov
2015-10-13 16:27:17 +03:00
parent 875eaa52e3
commit 87cfccc2d9
13 changed files with 316 additions and 634 deletions
@@ -453,10 +453,6 @@ public class JetParsing extends AbstractJetParsing {
PsiBuilder.Marker list = mark();
boolean empty = true;
while (!eof()) {
if (annotationParsingMode.atMemberStart && atSet(SOFT_KEYWORDS_AT_MEMBER_START)) break;
if ((annotationParsingMode == PRIMARY_CONSTRUCTOR_MODIFIER_LIST || annotationParsingMode == PRIMARY_CONSTRUCTOR_MODIFIER_LIST_LOCAL) &&
atSet(CONSTRUCTOR_KEYWORD, WHERE_KEYWORD)) break;
if (at(AT) && annotationParsingMode.allowAnnotations) {
parseAnnotationOrList(annotationParsingMode);
}
@@ -809,10 +805,7 @@ public class JetParsing extends AbstractJetParsing {
PsiBuilder.Marker beforeConstructorModifiers = mark();
PsiBuilder.Marker primaryConstructorMarker = mark();
boolean hasConstructorModifiers = parseModifierList(
declarationParsingMode != LOCAL ? PRIMARY_CONSTRUCTOR_MODIFIER_LIST : PRIMARY_CONSTRUCTOR_MODIFIER_LIST_LOCAL,
TokenSet.EMPTY
);
boolean hasConstructorModifiers = parseModifierList(ONLY_ESCAPED_REGULAR_ANNOTATIONS, TokenSet.EMPTY);
// Some modifiers found, but no parentheses following: class has already ended, and we are looking at something else
if (hasConstructorModifiers && !atSet(LPAR, LBRACE, COLON, CONSTRUCTOR_KEYWORD)) {
@@ -1058,7 +1051,7 @@ public class JetParsing extends AbstractJetParsing {
PsiBuilder.Marker decl = mark();
ModifierDetector detector = new ModifierDetector();
parseModifierList(detector, ALLOW_UNESCAPED_REGULAR_ANNOTATIONS_AT_MEMBER_MODIFIER_LIST, TokenSet.EMPTY);
parseModifierList(detector, ONLY_ESCAPED_REGULAR_ANNOTATIONS, TokenSet.EMPTY);
IElementType declType = parseMemberDeclarationRest(detector.isEnumDetected(), detector.isDefaultDetected());
@@ -2267,30 +2260,23 @@ public class JetParsing extends AbstractJetParsing {
}
enum AnnotationParsingMode {
FILE_ANNOTATIONS_BEFORE_PACKAGE(false, true, false, true),
FILE_ANNOTATIONS_WHEN_PACKAGE_OMITTED(false, true, false, true),
ONLY_ESCAPED_REGULAR_ANNOTATIONS(false, false, false, true),
ALLOW_UNESCAPED_REGULAR_ANNOTATIONS(true, false, false, true),
ALLOW_UNESCAPED_REGULAR_ANNOTATIONS_AT_MEMBER_MODIFIER_LIST(true, false, true, true),
PRIMARY_CONSTRUCTOR_MODIFIER_LIST(true, false, false, true),
PRIMARY_CONSTRUCTOR_MODIFIER_LIST_LOCAL(false, false, false, true),
NO_ANNOTATIONS(false, false, false, false);
FILE_ANNOTATIONS_BEFORE_PACKAGE(false, true, true),
FILE_ANNOTATIONS_WHEN_PACKAGE_OMITTED(false, true, true),
ONLY_ESCAPED_REGULAR_ANNOTATIONS(false, false, true),
ALLOW_UNESCAPED_REGULAR_ANNOTATIONS(true, false, true),
NO_ANNOTATIONS(false, false, false);
boolean allowShortAnnotations;
boolean isFileAnnotationParsingMode;
boolean atMemberStart;
boolean allowAnnotations;
AnnotationParsingMode(
boolean allowShortAnnotations,
boolean isFileAnnotationParsingMode,
boolean atMemberStart,
boolean allowAnnotations
) {
this.allowShortAnnotations = allowShortAnnotations;
this.isFileAnnotationParsingMode = isFileAnnotationParsingMode;
this.atMemberStart = atMemberStart;
this.allowAnnotations = allowAnnotations;
}
}
+9 -16
View File
@@ -34,23 +34,16 @@ JetFile: EnumOldConstructorSyntax.kt
PsiErrorElement:Expecting member declaration
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('My')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('13')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace('\n\n ')
PROPERTY
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('My')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('13')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n\n ')
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('y')
+2 -20
View File
@@ -19,17 +19,8 @@ JetFile: InterfaceWithEnumKeyword.kt
CLASS_BODY
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('D')
PsiErrorElement:Expecting member declaration
<empty list>
PsiElement(IDENTIFIER)('D')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n')
@@ -46,17 +37,8 @@ JetFile: InterfaceWithEnumKeyword.kt
CLASS_BODY
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('D')
PsiErrorElement:Expecting member declaration
<empty list>
PsiElement(IDENTIFIER)('D')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n')
+7 -13
View File
@@ -28,22 +28,16 @@ JetFile: NonTypeBeforeDotInBaseClass.kt
PsiElement(super)('super')
PsiErrorElement:Expecting member declaration
PsiElement(DOT)('.')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('ClassA')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
FUN
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('ClassA')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiErrorElement:Expecting member declaration
<empty list>
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
+1 -10
View File
@@ -31,17 +31,8 @@ JetFile: SimpleClassMembers_ERR.kt
CLASS_BODY
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('sdfsd')
PsiErrorElement:Expecting member declaration
<empty list>
PsiElement(IDENTIFIER)('sdfsd')
PsiWhiteSpace('\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
+240 -455
View File
@@ -296,64 +296,38 @@ JetFile: ShortAnnotations.kt
CLASS_BODY
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('bar')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('buzz')
PsiErrorElement:Expecting member declaration
PsiElement(LT)('<')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('T')
PsiErrorElement:Expecting member declaration
PsiElement(GT)('>')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
OBJECT_DECLARATION
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('buzz')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PsiElement(companion)('companion')
PsiWhiteSpace(' ')
PsiElement(object)('object')
@@ -362,189 +336,108 @@ JetFile: ShortAnnotations.kt
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('bar')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('buzz')
PsiErrorElement:Expecting member declaration
PsiElement(LT)('<')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('T')
PsiErrorElement:Expecting member declaration
PsiElement(GT)('>')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
CLASS
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('buzz')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiWhiteSpace('\n ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('bar')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('buzz')
PsiErrorElement:Expecting member declaration
PsiElement(LT)('<')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('T')
PsiErrorElement:Expecting member declaration
PsiElement(GT)('>')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
OBJECT_DECLARATION
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('buzz')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PsiElement(object)('object')
PsiWhiteSpace(' ')
OBJECT_DECLARATION_NAME
PsiElement(IDENTIFIER)('B')
PsiWhiteSpace('\n ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('bar')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('buzz')
PsiErrorElement:Expecting member declaration
PsiElement(LT)('<')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('T')
PsiErrorElement:Expecting member declaration
PsiElement(GT)('>')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
FUN
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('buzz')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
@@ -556,64 +449,37 @@ JetFile: ShortAnnotations.kt
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('bar')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('buzz')
PsiErrorElement:Expecting member declaration
PsiElement(LT)('<')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('T')
PsiErrorElement:Expecting member declaration
PsiElement(GT)('>')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PROPERTY
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('buzz')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('c')
@@ -630,64 +496,37 @@ JetFile: ShortAnnotations.kt
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('0')
PsiWhiteSpace('\n ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('bar')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('buzz')
PsiErrorElement:Expecting member declaration
PsiElement(LT)('<')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('T')
PsiErrorElement:Expecting member declaration
PsiElement(GT)('>')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PROPERTY
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('buzz')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PsiElement(var)('var')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('v')
@@ -704,64 +543,37 @@ JetFile: ShortAnnotations.kt
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('0')
PsiWhiteSpace('\n ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('bar')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('buzz')
PsiErrorElement:Expecting member declaration
PsiElement(LT)('<')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('T')
PsiErrorElement:Expecting member declaration
PsiElement(GT)('>')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
TYPEDEF
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('buzz')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PsiElement(typealias)('typealias')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
@@ -773,64 +585,37 @@ JetFile: ShortAnnotations.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
PsiWhiteSpace('\n\n ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('bar')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('buzz')
PsiErrorElement:Expecting member declaration
PsiElement(LT)('<')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('T')
PsiErrorElement:Expecting member declaration
PsiElement(GT)('>')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(INTEGER_LITERAL)('1')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
ANONYMOUS_INITIALIZER
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('buzz')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RPAR)(')')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('zoo')
PsiWhiteSpace(' ')
PsiElement(init)('init')
PsiWhiteSpace(' ')
BLOCK
@@ -56,20 +56,13 @@ JetFile: oldUsages.kt
PsiWhiteSpace('\n\n ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('kotlin')
PsiErrorElement:Expecting member declaration
PsiElement(DOT)('.')
FUN
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('kotlin')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('inline')
PsiElement(inline)('inline')
PsiWhiteSpace(' ')
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
+19 -39
View File
@@ -50,32 +50,19 @@ JetFile: recovery.kt
PsiElement(class)('class')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A1')
PsiWhiteSpace(' ')
PRIMARY_CONSTRUCTOR
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Ann')
PsiErrorElement:Expecting 'constructor' keyword
<empty list>
PsiWhiteSpace(' ')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting a top level declaration
PsiElement(IDENTIFIER)('Ann')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting a top level declaration
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST
DELEGATOR_SUPER_CALL
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Base')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting a top level declaration
PsiElement(IDENTIFIER)('Base')
PsiErrorElement:Expecting a top level declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting a top level declaration
PsiElement(RPAR)(')')
PsiWhiteSpace('\n\n')
CLASS
PsiElement(class)('class')
@@ -89,21 +76,14 @@ JetFile: recovery.kt
PsiElement(class)('class')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A3')
PsiWhiteSpace(' ')
PRIMARY_CONSTRUCTOR
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Ann')
PsiErrorElement:Expecting 'constructor' keyword
PsiWhiteSpace(' ')
PsiErrorElement:Expecting a top level declaration
PsiElement(IDENTIFIER)('Ann')
PsiWhiteSpace(' ')
FUN
PsiErrorElement:Expecting a top level declaration
<empty list>
PsiWhiteSpace(' ')
CLASS_BODY
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
FUN
@@ -226,20 +226,13 @@ JetFile: recoveryNestedClassAmbiguity.kt
PsiWhiteSpace('\n ')
MODIFIER_LIST
PsiElement(private)('private')
PsiErrorElement:Use '@' symbol before annotations
<empty list>
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Ann')
PsiWhiteSpace(' ')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
<empty list>
PsiElement(IDENTIFIER)('Ann')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
+1 -1
View File
@@ -12,4 +12,4 @@ class A4 private @Ann(1) constructor(y: Int)
class A5 @Ann private constructor() {}
class A6 Ann() private constructor() {}
class A6 @Ann() private constructor() {}
+1 -2
View File
@@ -209,9 +209,8 @@ JetFile: valid.kt
PsiWhiteSpace(' ')
PRIMARY_CONSTRUCTOR
MODIFIER_LIST
PsiErrorElement:Use '@' symbol before annotations
<empty list>
ANNOTATION_ENTRY
PsiElement(AT)('@')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
@@ -4,7 +4,7 @@ class A {
constructor():
ann fun foo()
@ann fun foo()
constructor(): sup
@@ -21,18 +21,14 @@ JetFile: recoveryWithoutBodyWrongDelegationName.kt
CONSTRUCTOR_DELEGATION_CALL
PsiErrorElement:Expecting a 'this' or 'super' constructor call
<empty list>
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('thi')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
PROPERTY
MODIFIER_LIST
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('thi')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('x')
@@ -56,6 +52,7 @@ JetFile: recoveryWithoutBodyWrongDelegationName.kt
FUN
MODIFIER_LIST
ANNOTATION_ENTRY
PsiElement(AT)('@')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
@@ -79,15 +76,10 @@ JetFile: recoveryWithoutBodyWrongDelegationName.kt
CONSTRUCTOR_DELEGATION_CALL
PsiErrorElement:Expecting a 'this' or 'super' constructor call
<empty list>
PsiErrorElement:Expecting member declaration
PsiElement(IDENTIFIER)('sup')
PsiWhiteSpace('\n\n ')
SECONDARY_CONSTRUCTOR
MODIFIER_LIST
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('sup')
PsiWhiteSpace('\n\n ')
PsiElement(constructor)('constructor')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
@@ -97,18 +89,12 @@ JetFile: recoveryWithoutBodyWrongDelegationName.kt
CONSTRUCTOR_DELEGATION_CALL
PsiErrorElement:Expecting a 'this' or 'super' constructor call
<empty list>
MODIFIER_LIST
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('thi')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiErrorElement:Expecting member declaration
<empty list>
PsiElement(IDENTIFIER)('thi')
PsiErrorElement:Expecting member declaration
PsiElement(LPAR)('(')
PsiErrorElement:Expecting member declaration
PsiElement(RPAR)(')')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n')