Report syntax error on unescaped annotation
Also adjust parser testData
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
class Outer1 {
|
||||
class Nested1
|
||||
|
||||
private Ann constructor()
|
||||
private @Ann constructor()
|
||||
}
|
||||
|
||||
class Outer2 {
|
||||
class Nested2;
|
||||
|
||||
private Ann constructor()
|
||||
private @Ann constructor()
|
||||
}
|
||||
|
||||
class Outer3 {
|
||||
class Nested3
|
||||
|
||||
private Ann constructor() : super() {}
|
||||
private @Ann constructor() : super() {}
|
||||
}
|
||||
|
||||
class Outer4 {
|
||||
|
||||
@@ -21,6 +21,7 @@ JetFile: nestedClassAmbiguity.kt
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -53,6 +54,7 @@ JetFile: nestedClassAmbiguity.kt
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -87,6 +89,7 @@ JetFile: nestedClassAmbiguity.kt
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
|
||||
+3
-3
@@ -13,6 +13,6 @@ class A3 Ann {
|
||||
class A4 constructor {}
|
||||
class A5 constructor : Base {}
|
||||
|
||||
class A7 Ann(1) (x: Int)
|
||||
class A8 Ann() {}
|
||||
class A9 Ann() : Base()
|
||||
class A7 @Ann(1) (x: Int)
|
||||
class A8 @Ann() {}
|
||||
class A9 @Ann() : Base()
|
||||
|
||||
+10
-1
@@ -57,6 +57,8 @@ JetFile: recovery.kt
|
||||
PsiWhiteSpace(' ')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
MODIFIER_LIST
|
||||
PsiErrorElement:Use '@' symbol before annotations
|
||||
<empty list>
|
||||
ANNOTATION_ENTRY
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
@@ -86,6 +88,8 @@ JetFile: recovery.kt
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS
|
||||
MODIFIER_LIST
|
||||
PsiErrorElement:Use '@' symbol before annotations
|
||||
<empty list>
|
||||
ANNOTATION_ENTRY
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
@@ -99,6 +103,8 @@ JetFile: recovery.kt
|
||||
PsiWhiteSpace(' ')
|
||||
PRIMARY_CONSTRUCTOR
|
||||
MODIFIER_LIST
|
||||
PsiErrorElement:Use '@' symbol before annotations
|
||||
<empty list>
|
||||
ANNOTATION_ENTRY
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
@@ -166,6 +172,7 @@ JetFile: recovery.kt
|
||||
PRIMARY_CONSTRUCTOR
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -198,6 +205,7 @@ JetFile: recovery.kt
|
||||
PRIMARY_CONSTRUCTOR
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -221,6 +229,7 @@ JetFile: recovery.kt
|
||||
PRIMARY_CONSTRUCTOR
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -243,4 +252,4 @@ JetFile: recovery.kt
|
||||
PsiElement(IDENTIFIER)('Base')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(RPAR)(')')
|
||||
@@ -1,25 +1,30 @@
|
||||
class Outer1 {
|
||||
class Nested1
|
||||
|
||||
private Ann ()
|
||||
private @Ann ()
|
||||
}
|
||||
|
||||
class Outer2 {
|
||||
class Nested2 private Ann
|
||||
class Nested2 private @Ann
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
class Outer3 {
|
||||
class Nested3 private Ann {}
|
||||
class Nested3 private @Ann {}
|
||||
fun foo()
|
||||
}
|
||||
|
||||
class Outer4 {
|
||||
class Nested3 private Ann() {}
|
||||
class Nested3 private @Ann() {}
|
||||
fun foo()
|
||||
}
|
||||
|
||||
class Outer4 {
|
||||
class Nested3 private Ann() : Base()
|
||||
class Outer5 {
|
||||
class Nested3 private @Ann() : Base()
|
||||
fun foo()
|
||||
}
|
||||
|
||||
class Outer6 {
|
||||
class Nested1
|
||||
private Ann ()
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ JetFile: recoveryNestedClassAmbiguity.kt
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -52,6 +53,7 @@ JetFile: recoveryNestedClassAmbiguity.kt
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -89,6 +91,7 @@ JetFile: recoveryNestedClassAmbiguity.kt
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -129,6 +132,7 @@ JetFile: recoveryNestedClassAmbiguity.kt
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -157,7 +161,7 @@ JetFile: recoveryNestedClassAmbiguity.kt
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Outer4')
|
||||
PsiElement(IDENTIFIER)('Outer5')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
@@ -172,6 +176,7 @@ JetFile: recoveryNestedClassAmbiguity.kt
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -205,3 +210,36 @@ JetFile: recoveryNestedClassAmbiguity.kt
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Outer6')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Nested1')
|
||||
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)(')')
|
||||
PsiErrorElement:Expecting member declaration
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
+4
-2
@@ -6,8 +6,10 @@ private constructor(y: Int) : Base1(), Base2 {
|
||||
}
|
||||
class A2 @private constructor(y: Int)
|
||||
|
||||
class A3 Ann(1) private constructor(y: Int)
|
||||
class A3 @Ann(1) private constructor(y: Int)
|
||||
|
||||
class A4 private Ann(1) constructor(y: Int)
|
||||
class A4 private @Ann(1) constructor(y: Int)
|
||||
|
||||
class A5 @Ann private constructor() {}
|
||||
|
||||
class A6 Ann() private constructor() {}
|
||||
|
||||
@@ -112,6 +112,7 @@ JetFile: valid.kt
|
||||
PRIMARY_CONSTRUCTOR
|
||||
MODIFIER_LIST
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -149,6 +150,7 @@ JetFile: valid.kt
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
ANNOTATION_ENTRY
|
||||
PsiElement(AT)('@')
|
||||
CONSTRUCTOR_CALLEE
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -199,3 +201,33 @@ JetFile: valid.kt
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('A6')
|
||||
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')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(private)('private')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(constructor)('constructor')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
Reference in New Issue
Block a user