diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java index 6fab4b4a006..f124063866b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java @@ -72,7 +72,6 @@ public class JetExpressionParsing extends AbstractJetParsing { // Prefix MINUS, PLUS, MINUSMINUS, PLUSPLUS, EXCL, EXCLEXCL, // Joining complex tokens makes it necessary to put EXCLEXCL here - LBRACKET, // Atomic COLONCOLON, // callable reference @@ -121,7 +120,6 @@ public class JetExpressionParsing extends AbstractJetParsing { EXPRESSION_FIRST, TokenSet.create( // declaration - LBRACKET, // annotation FUN_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, TRAIT_KEYWORD, @@ -343,7 +341,7 @@ public class JetExpressionParsing extends AbstractJetParsing { private void parsePrefixExpression() { // System.out.println("pre at " + myBuilder.getTokenText()); - if (at(LBRACKET) || at(AT)) { + if (at(AT)) { if (!parseLocalDeclaration()) { PsiBuilder.Marker expression = mark(); myJetParsing.parseAnnotations(ONLY_ESCAPED_REGULAR_ANNOTATIONS); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java index e2559f8f3f9..ff58f17c449 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java @@ -453,8 +453,8 @@ public class JetParsing extends AbstractJetParsing { else if (tryParseModifier(tokenConsumer)) { // modifier advanced } - else if (at(LBRACKET) || (annotationParsingMode.allowShortAnnotations && at(IDENTIFIER))) { - parseAnnotation(annotationParsingMode); + else if (annotationParsingMode.allowShortAnnotations && at(IDENTIFIER)) { + parseAnnotationEntry(annotationParsingMode); } else { break; @@ -534,10 +534,7 @@ public class JetParsing extends AbstractJetParsing { * ; */ private boolean parseAnnotation(AnnotationParsingMode mode) { - if (at(LBRACKET)) { - return parseAnnotationList(mode, false); - } - else if (mode.allowShortAnnotations && at(IDENTIFIER)) { + if (mode.allowShortAnnotations && at(IDENTIFIER)) { return parseAnnotationEntry(mode); } else if (at(AT)) { @@ -559,7 +556,7 @@ public class JetParsing extends AbstractJetParsing { return parseAnnotationEntry(mode); } else if (tokenToMatch == LBRACKET) { - return parseAnnotationList(mode, true); + return parseAnnotationList(mode); } else { if (isTargetedAnnotation) { @@ -580,14 +577,13 @@ public class JetParsing extends AbstractJetParsing { return false; } - private boolean parseAnnotationList(AnnotationParsingMode mode, boolean expectAtSymbol) { - assert !expectAtSymbol || _at(AT); - assert expectAtSymbol || _at(LBRACKET); + private boolean parseAnnotationList(AnnotationParsingMode mode) { + assert _at(AT); PsiBuilder.Marker annotation = mark(); myBuilder.disableNewlines(); - advance(); // AT or LBRACKET + advance(); // AT if (!parseAnnotationTargetIfNeeded(mode)) { annotation.rollbackTo(); @@ -595,10 +591,8 @@ public class JetParsing extends AbstractJetParsing { return false; } - if (expectAtSymbol) { - assert _at(LBRACKET); - advance(); // LBRACKET - } + assert _at(LBRACKET); + advance(); // LBRACKET if (!at(IDENTIFIER) && !at(AT)) { error("Expecting a list of annotations"); @@ -1389,7 +1383,7 @@ public class JetParsing extends AbstractJetParsing { if (!at(LPAR)) { // Account for Jet-114 (val a : int get {...}) - TokenSet ACCESSOR_FIRST_OR_PROPERTY_END = TokenSet.orSet(MODIFIER_KEYWORDS, TokenSet.create(LBRACKET, AT, GET_KEYWORD, SET_KEYWORD, EOL_OR_SEMICOLON, RBRACE)); + TokenSet ACCESSOR_FIRST_OR_PROPERTY_END = TokenSet.orSet(MODIFIER_KEYWORDS, TokenSet.create(AT, GET_KEYWORD, SET_KEYWORD, EOL_OR_SEMICOLON, RBRACE)); if (!atSet(ACCESSOR_FIRST_OR_PROPERTY_END)) { errorUntil("Accessor body expected", TokenSet.orSet(ACCESSOR_FIRST_OR_PROPERTY_END, TokenSet.create(LBRACE, LPAR, EQ))); } diff --git a/compiler/testData/psi/DocCommentAfterFileAnnotations.kt b/compiler/testData/psi/DocCommentAfterFileAnnotations.kt index 24047353950..2d4b5a22fa7 100644 --- a/compiler/testData/psi/DocCommentAfterFileAnnotations.kt +++ b/compiler/testData/psi/DocCommentAfterFileAnnotations.kt @@ -1,4 +1,4 @@ -[file:volatile] +@file:[volatile] /** * Doc comment */ diff --git a/compiler/testData/psi/DocCommentAfterFileAnnotations.txt b/compiler/testData/psi/DocCommentAfterFileAnnotations.txt index 68cfb707559..27adf18aaa2 100644 --- a/compiler/testData/psi/DocCommentAfterFileAnnotations.txt +++ b/compiler/testData/psi/DocCommentAfterFileAnnotations.txt @@ -1,9 +1,10 @@ JetFile: DocCommentAfterFileAnnotations.kt FILE_ANNOTATION_LIST ANNOTATION - PsiElement(LBRACKET)('[') + PsiElement(AT)('@') PsiElement(file)('file') PsiElement(COLON)(':') + PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE @@ -31,4 +32,4 @@ JetFile: DocCommentAfterFileAnnotations.kt PsiElement(IDENTIFIER)('C') CLASS_BODY PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/DynamicSoftKeyword.kt b/compiler/testData/psi/DynamicSoftKeyword.kt index 617940f2001..198b1129efd 100644 --- a/compiler/testData/psi/DynamicSoftKeyword.kt +++ b/compiler/testData/psi/DynamicSoftKeyword.kt @@ -1,5 +1,5 @@ dynamic class dynamic(dynamic: dynamic) : dynamic { - [dynamic] fun dynamic() { + @dynamic fun dynamic() { val dynamic = 1 dynamic::foo } diff --git a/compiler/testData/psi/DynamicSoftKeyword.txt b/compiler/testData/psi/DynamicSoftKeyword.txt index 669e88d37c8..84057a7ce69 100644 --- a/compiler/testData/psi/DynamicSoftKeyword.txt +++ b/compiler/testData/psi/DynamicSoftKeyword.txt @@ -45,15 +45,13 @@ JetFile: DynamicSoftKeyword.kt PsiWhiteSpace('\n ') FUN MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('dynamic') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('dynamic') PsiWhiteSpace(' ') PsiElement(fun)('fun') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/DynamicTypes.kt b/compiler/testData/psi/DynamicTypes.kt index 24a0da87a41..0f8f033e5d9 100644 --- a/compiler/testData/psi/DynamicTypes.kt +++ b/compiler/testData/psi/DynamicTypes.kt @@ -1,6 +1,6 @@ fun foo( p1: dynamic, - p2: [a] dynamic, + p2: @a dynamic, p3: foo.dynamic, p4: dynamic.foo, p5: dynamic, diff --git a/compiler/testData/psi/DynamicTypes.txt b/compiler/testData/psi/DynamicTypes.txt index 96ed170e92f..9989f5dd044 100644 --- a/compiler/testData/psi/DynamicTypes.txt +++ b/compiler/testData/psi/DynamicTypes.txt @@ -24,15 +24,13 @@ JetFile: DynamicTypes.kt PsiElement(COLON)(':') PsiWhiteSpace(' ') TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') DYNAMIC_TYPE PsiElement(dynamic)('dynamic') diff --git a/compiler/testData/psi/EOLsOnRollback.kt b/compiler/testData/psi/EOLsOnRollback.kt index 7b1ad990541..d92e3e2f773 100644 --- a/compiler/testData/psi/EOLsOnRollback.kt +++ b/compiler/testData/psi/EOLsOnRollback.kt @@ -6,8 +6,8 @@ fun foo() { typealias x = t var r - [a] var foo = 4 + @a var foo = 4 1 - [a] val f + @a val f } \ No newline at end of file diff --git a/compiler/testData/psi/EOLsOnRollback.txt b/compiler/testData/psi/EOLsOnRollback.txt index 9f57ac39837..41d5803abab 100644 --- a/compiler/testData/psi/EOLsOnRollback.txt +++ b/compiler/testData/psi/EOLsOnRollback.txt @@ -51,15 +51,13 @@ JetFile: EOLsOnRollback.kt PsiWhiteSpace('\n\n ') PROPERTY MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(var)('var') PsiWhiteSpace(' ') @@ -75,18 +73,16 @@ JetFile: EOLsOnRollback.kt PsiWhiteSpace('\n ') PROPERTY MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('f') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/FunctionExpressions.kt b/compiler/testData/psi/FunctionExpressions.kt index 18b9530e2fb..1ae1ad4b770 100644 --- a/compiler/testData/psi/FunctionExpressions.kt +++ b/compiler/testData/psi/FunctionExpressions.kt @@ -1,37 +1,37 @@ val a = fun () val a = fun name() val a = fun T.name() -val a = fun [a] T.(a : foo) : bar -val a = fun [a] T.name(a : foo) : bar -val a = fun [a()] T. b>(a : foo) : bar +val a = fun @[a] T.(a : foo) : bar +val a = fun @[a] T.name(a : foo) : bar +val a = fun @[a()] T. b>(a : foo) : bar fun c() = fun (); fun c() = fun name(); -fun c() = fun [a] T.(); -fun c() = fun [a] T.(a : foo) : bar; -fun c() = fun [a()] T. b>(a : foo) : bar; +fun c() = fun @[a] T.(); +fun c() = fun @[a] T.(a : foo) : bar; +fun c() = fun @[a()] T. b>(a : foo) : bar; val d = fun () = a val d = fun name() = a -val a = [a] fun () +val a = @[a] fun () val b = fun () where T: A fun outer() { bar(fun () {}) bar(fun name() {}) - bar(fun [a] T.() {}) - bar(fun [a] T.name() {}) + bar(fun @[a] T.() {}) + bar(fun @[a] T.name() {}) - bar(fun [a] T.(a : foo) : bar {}) - bar(fun [a()] T. b>(a : foo) : bar {}) + bar(fun @[a] T.(a : foo) : bar {}) + bar(fun @[a()] T. b>(a : foo) : bar {}) - bar {fun [a()] T. b>(a : foo) : bar {}} + bar {fun @[a()] T. b>(a : foo) : bar {}} bar {fun A?.() : bar?} bar {fun A? .() : bar?} bar(fun () = a) bar(fun name() = a) - bar([a] fun name() = a) + bar(@[a] fun name() = a) } diff --git a/compiler/testData/psi/FunctionExpressions.txt b/compiler/testData/psi/FunctionExpressions.txt index 6cb7576f921..6cd6044526e 100644 --- a/compiler/testData/psi/FunctionExpressions.txt +++ b/compiler/testData/psi/FunctionExpressions.txt @@ -64,6 +64,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -109,6 +110,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -155,6 +157,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -268,6 +271,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -301,6 +305,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -350,6 +355,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -461,6 +467,7 @@ JetFile: FunctionExpressions.kt FUN MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -568,6 +575,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -601,6 +609,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -635,6 +644,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -684,6 +694,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -764,6 +775,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -789,6 +801,7 @@ JetFile: FunctionExpressions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -955,6 +968,7 @@ JetFile: FunctionExpressions.kt FUN MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/FunctionExpressions_ERR.kt b/compiler/testData/psi/FunctionExpressions_ERR.kt index bfd35ec2970..a2f90771508 100644 --- a/compiler/testData/psi/FunctionExpressions_ERR.kt +++ b/compiler/testData/psi/FunctionExpressions_ERR.kt @@ -1,10 +1,10 @@ val a = fun ) val a = fun foo) -val a = fun [a] T.foo(a : ) : bar +val a = fun @[a] T.foo(a : ) : bar -val a = fun [a()] T.foo<>(a : foo) : bar -val a = fun [a()] T.<>(a : foo) : bar +val a = fun @[a()] T.foo<>(a : foo) : bar +val a = fun @[a()] T.<>(a : foo) : bar val a = fun T.foo(a : foo) : bar val a = fun T.foo<, T, , T>(a : foo) : bar @@ -24,7 +24,7 @@ fun outer() { bar(fun T) bar(fun T.) - bar(fun [a]) + bar(fun @[a]) bar(public fun ()) diff --git a/compiler/testData/psi/FunctionExpressions_ERR.txt b/compiler/testData/psi/FunctionExpressions_ERR.txt index cde71459324..73c89a739ca 100644 --- a/compiler/testData/psi/FunctionExpressions_ERR.txt +++ b/compiler/testData/psi/FunctionExpressions_ERR.txt @@ -46,6 +46,7 @@ JetFile: FunctionExpressions_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -91,6 +92,7 @@ JetFile: FunctionExpressions_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -145,6 +147,7 @@ JetFile: FunctionExpressions_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -546,6 +549,7 @@ JetFile: FunctionExpressions_ERR.kt PsiWhiteSpace(' ') PsiErrorElement:Annotations are not allowed in this position ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/FunctionLiterals.kt b/compiler/testData/psi/FunctionLiterals.kt index 0db6e14ea3d..846dfa4d972 100644 --- a/compiler/testData/psi/FunctionLiterals.kt +++ b/compiler/testData/psi/FunctionLiterals.kt @@ -26,7 +26,7 @@ fun foo() { {T.(a) : T -> a} {x, y -> 1} - {[a] x, [b] y, [c] z -> 1} + {@[a] x, @[b] y, @[c] z -> 1} {((a: Int = object { fun t() {} }) -> Int).(x: Int) : String -> "" } { A.B.(x: Int) -> } diff --git a/compiler/testData/psi/FunctionLiterals.txt b/compiler/testData/psi/FunctionLiterals.txt index 891bed11864..a272594a566 100644 --- a/compiler/testData/psi/FunctionLiterals.txt +++ b/compiler/testData/psi/FunctionLiterals.txt @@ -463,6 +463,7 @@ JetFile: FunctionLiterals.kt BLOCK ANNOTATED_EXPRESSION ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -477,6 +478,7 @@ JetFile: FunctionLiterals.kt PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) PsiElement(COMMA)(',') PsiWhiteSpace(' ') + PsiElement(AT)('@') PsiElement(LBRACKET)('[') PsiElement(IDENTIFIER)('b') PsiElement(RBRACKET)(']') @@ -484,6 +486,7 @@ JetFile: FunctionLiterals.kt PsiElement(IDENTIFIER)('y') PsiElement(COMMA)(',') PsiWhiteSpace(' ') + PsiElement(AT)('@') PsiElement(LBRACKET)('[') PsiElement(IDENTIFIER)('c') PsiElement(RBRACKET)(']') diff --git a/compiler/testData/psi/FunctionTypes.kt b/compiler/testData/psi/FunctionTypes.kt index 7ed7c03bc0a..79ec7fcb8f0 100644 --- a/compiler/testData/psi/FunctionTypes.kt +++ b/compiler/testData/psi/FunctionTypes.kt @@ -1,14 +1,14 @@ -typealias f = ([a] a) -> b +typealias f = (@[a] a) -> b typealias f = (a) -> b -typealias f = () -> [x] b +typealias f = () -> @[x] b typealias f = () -> Unit -typealias f = (a : [a] a) -> b +typealias f = (a : @[a] a) -> b typealias f = (a : a) -> b typealias f = () -> b typealias f = () -> Unit -typealias f = (a : [a] a, foo, x : bar) -> b +typealias f = (a : @[a] a, foo, x : bar) -> b typealias f = (foo, a : a) -> b typealias f = (foo, a : (a) -> b) -> b typealias f = (foo, a : (a) -> b) -> () -> Unit @@ -19,6 +19,6 @@ typealias f = T.() -> Unit typealias f = T.T.() -> Unit typealias f = T.T.() -> Unit -typealias f = [a] T.() -> Unit -typealias f = [a] T.T.() -> Unit -typealias f = [a] T.T.() -> Unit +typealias f = @[a] T.() -> Unit +typealias f = @[a] T.T.() -> Unit +typealias f = @[a] T.T.() -> Unit diff --git a/compiler/testData/psi/FunctionTypes.txt b/compiler/testData/psi/FunctionTypes.txt index 299be89c6ef..4f866a7d39e 100644 --- a/compiler/testData/psi/FunctionTypes.txt +++ b/compiler/testData/psi/FunctionTypes.txt @@ -17,6 +17,7 @@ JetFile: FunctionTypes.kt VALUE_PARAMETER MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -81,6 +82,7 @@ JetFile: FunctionTypes.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -132,6 +134,7 @@ JetFile: FunctionTypes.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -240,6 +243,7 @@ JetFile: FunctionTypes.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -544,6 +548,7 @@ JetFile: FunctionTypes.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -580,6 +585,7 @@ JetFile: FunctionTypes.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -620,6 +626,7 @@ JetFile: FunctionTypes.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/Functions.kt b/compiler/testData/psi/Functions.kt index ee9fb2d1e90..14c7f746bef 100644 --- a/compiler/testData/psi/Functions.kt +++ b/compiler/testData/psi/Functions.kt @@ -1,22 +1,22 @@ fun foo() -fun [a] foo() -fun [a] T.foo() -fun [a] T.foo(a : foo) : bar -fun [a()] T.foo b>(a : foo) : bar +fun @[a] foo() +fun @[a] T.foo() +fun @[a] T.foo(a : foo) : bar +fun @[a()] T.foo b>(a : foo) : bar fun foo(); -fun [a] foo(); -fun [a] T.foo(); -fun [a] T.foo(a : foo) : bar; -fun [a()] T.foo b>(a : foo) : bar; +fun @[a] foo(); +fun @[a] T.foo(); +fun @[a] T.foo(a : foo) : bar; +fun @[a()] T.foo b>(a : foo) : bar; fun foo() {} -fun [a] foo() {} -fun [a] T.foo() {} -fun [a] T.foo(a : foo) : bar {} -fun [a()] T.foo b>(a : foo) : bar {} +fun @[a] foo() {} +fun @[a] T.foo() {} +fun @[a] T.foo(a : foo) : bar {} +fun @[a()] T.foo b>(a : foo) : bar {} -fun [a()] T.foo b>(a : foo) : bar {} +fun @[a()] T.foo b>(a : foo) : bar {} fun A?.foo() : bar? fun A? .foo() : bar? diff --git a/compiler/testData/psi/Functions.txt b/compiler/testData/psi/Functions.txt index 8afdffcdf85..adc9bca7695 100644 --- a/compiler/testData/psi/Functions.txt +++ b/compiler/testData/psi/Functions.txt @@ -16,6 +16,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') PsiErrorElement:Annotations are not allowed in this position ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -35,6 +36,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -58,6 +60,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -97,6 +100,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -173,6 +177,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') PsiErrorElement:Annotations are not allowed in this position ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -193,6 +198,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -217,6 +223,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -257,6 +264,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -337,6 +345,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') PsiErrorElement:Annotations are not allowed in this position ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -360,6 +369,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -387,6 +397,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -430,6 +441,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -501,6 +513,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -527,6 +540,7 @@ JetFile: Functions.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/FunctionsWithoutName.kt b/compiler/testData/psi/FunctionsWithoutName.kt index ecd22e58957..411a930cc16 100644 --- a/compiler/testData/psi/FunctionsWithoutName.kt +++ b/compiler/testData/psi/FunctionsWithoutName.kt @@ -9,10 +9,10 @@ fun T.(a : foo) : bar; fun T. b>(a : foo) : bar; fun () {} -fun [a] T.() {} -fun [a] T.(a : foo) : bar {} -fun [a()] T. b>(a : foo) : bar {} -fun [a()] T. b>(a : foo) : bar {} +fun @[a] T.() {} +fun @[a] T.(a : foo) : bar {} +fun @[a()] T. b>(a : foo) : bar {} +fun @[a()] T. b>(a : foo) : bar {} fun A?.() : bar? fun A? .() : bar? \ No newline at end of file diff --git a/compiler/testData/psi/FunctionsWithoutName.txt b/compiler/testData/psi/FunctionsWithoutName.txt index 6be857e3f52..d99feebb2ed 100644 --- a/compiler/testData/psi/FunctionsWithoutName.txt +++ b/compiler/testData/psi/FunctionsWithoutName.txt @@ -223,6 +223,7 @@ JetFile: FunctionsWithoutName.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -249,6 +250,7 @@ JetFile: FunctionsWithoutName.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -291,6 +293,7 @@ JetFile: FunctionsWithoutName.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -361,6 +364,7 @@ JetFile: FunctionsWithoutName.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -386,6 +390,7 @@ JetFile: FunctionsWithoutName.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/FunctionsWithoutName_ERR.kt b/compiler/testData/psi/FunctionsWithoutName_ERR.kt index 7829f38bd72..4238e75cc25 100644 --- a/compiler/testData/psi/FunctionsWithoutName_ERR.kt +++ b/compiler/testData/psi/FunctionsWithoutName_ERR.kt @@ -1,8 +1,8 @@ fun ) -fun [a] T.(a : ) : bar -fun [a()] T.<>(a : foo) : bar -fun [a()] T.(a : foo) : bar -fun [a()] T.<, T, , T>(a : foo) : bar -fun [a()] T.(, a : foo, , a: b) : bar +fun @[a] T.(a : ) : bar +fun @[a()] T.<>(a : foo) : bar +fun @[a()] T.(a : foo) : bar +fun @[a()] T.<, T, , T>(a : foo) : bar +fun @[a()] T.(, a : foo, , a: b) : bar fun () : = a; \ No newline at end of file diff --git a/compiler/testData/psi/FunctionsWithoutName_ERR.txt b/compiler/testData/psi/FunctionsWithoutName_ERR.txt index a00d6a27365..685c0a49404 100644 --- a/compiler/testData/psi/FunctionsWithoutName_ERR.txt +++ b/compiler/testData/psi/FunctionsWithoutName_ERR.txt @@ -16,6 +16,7 @@ JetFile: FunctionsWithoutName_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -53,6 +54,7 @@ JetFile: FunctionsWithoutName_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -99,6 +101,7 @@ JetFile: FunctionsWithoutName_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -152,6 +155,7 @@ JetFile: FunctionsWithoutName_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -208,6 +212,7 @@ JetFile: FunctionsWithoutName_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/Functions_ERR.kt b/compiler/testData/psi/Functions_ERR.kt index 78c8888e092..21ba7455331 100644 --- a/compiler/testData/psi/Functions_ERR.kt +++ b/compiler/testData/psi/Functions_ERR.kt @@ -1,9 +1,9 @@ fun foo) -fun [a] T.foo(a : ) : bar -fun [a()] T.foo<>(a : foo) : bar -fun [a()] T.foo(a : foo) : bar -fun [a()] T.foo<, T, , T>(a : foo) : bar -fun [a()] T.foo(, a : foo, , a: b) : bar +fun @[a] T.foo(a : ) : bar +fun @[a()] T.foo<>(a : foo) : bar +fun @[a()] T.foo(a : foo) : bar +fun @[a()] T.foo<, T, , T>(a : foo) : bar +fun @[a()] T.foo(, a : foo, , a: b) : bar fun foo() : = a; fun foo() = ; \ No newline at end of file diff --git a/compiler/testData/psi/Functions_ERR.txt b/compiler/testData/psi/Functions_ERR.txt index 0a7f351a212..377dcf352ee 100644 --- a/compiler/testData/psi/Functions_ERR.txt +++ b/compiler/testData/psi/Functions_ERR.txt @@ -17,6 +17,7 @@ JetFile: Functions_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -55,6 +56,7 @@ JetFile: Functions_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -102,6 +104,7 @@ JetFile: Functions_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -156,6 +159,7 @@ JetFile: Functions_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -213,6 +217,7 @@ JetFile: Functions_ERR.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/LineCommentAfterFileAnnotations.kt b/compiler/testData/psi/LineCommentAfterFileAnnotations.kt index 74240d85be7..f69e9245703 100644 --- a/compiler/testData/psi/LineCommentAfterFileAnnotations.kt +++ b/compiler/testData/psi/LineCommentAfterFileAnnotations.kt @@ -1,3 +1,3 @@ -[file:volatile] +@file:[volatile] // class C class C{} \ No newline at end of file diff --git a/compiler/testData/psi/LineCommentAfterFileAnnotations.txt b/compiler/testData/psi/LineCommentAfterFileAnnotations.txt index 93ecea35261..2ea22297fa9 100644 --- a/compiler/testData/psi/LineCommentAfterFileAnnotations.txt +++ b/compiler/testData/psi/LineCommentAfterFileAnnotations.txt @@ -1,9 +1,10 @@ JetFile: LineCommentAfterFileAnnotations.kt FILE_ANNOTATION_LIST ANNOTATION - PsiElement(LBRACKET)('[') + PsiElement(AT)('@') PsiElement(file)('file') PsiElement(COLON)(':') + PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE diff --git a/compiler/testData/psi/LocalDeclarations.kt b/compiler/testData/psi/LocalDeclarations.kt index c66ba32efec..d0939b50c72 100644 --- a/compiler/testData/psi/LocalDeclarations.kt +++ b/compiler/testData/psi/LocalDeclarations.kt @@ -1,11 +1,11 @@ fun foo() { out 1 - [a] abstract class foof {} - abstract [a] class foof {} + @a abstract class foof {} + abstract @a class foof {} out val foo = 5 - [a] var foo = 4 + @a var foo = 4 typealias f = T.() -> Unit } diff --git a/compiler/testData/psi/LocalDeclarations.txt b/compiler/testData/psi/LocalDeclarations.txt index f3c370a5cd0..421edd50d1c 100644 --- a/compiler/testData/psi/LocalDeclarations.txt +++ b/compiler/testData/psi/LocalDeclarations.txt @@ -22,15 +22,13 @@ JetFile: LocalDeclarations.kt PsiWhiteSpace('\n ') CLASS MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(abstract)('abstract') PsiWhiteSpace(' ') @@ -46,15 +44,13 @@ JetFile: LocalDeclarations.kt MODIFIER_LIST PsiElement(abstract)('abstract') PsiWhiteSpace(' ') - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(class)('class') PsiWhiteSpace(' ') @@ -79,15 +75,13 @@ JetFile: LocalDeclarations.kt PsiWhiteSpace('\n ') PROPERTY MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(var)('var') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/Properties.kt b/compiler/testData/psi/Properties.kt index 54939d28aba..c8d2ab95d00 100644 --- a/compiler/testData/psi/Properties.kt +++ b/compiler/testData/psi/Properties.kt @@ -1,11 +1,11 @@ val foo = bar.foo.bar val foo -val [a] foo +val @[a] foo val foo.bar val foo : T -val [a] foo = bar +val @[a] foo = bar val foo.bar get() {} set(sad) = foo diff --git a/compiler/testData/psi/Properties.txt b/compiler/testData/psi/Properties.txt index deaf430d772..4bee4077a86 100644 --- a/compiler/testData/psi/Properties.txt +++ b/compiler/testData/psi/Properties.txt @@ -31,6 +31,7 @@ JetFile: Properties.kt PsiWhiteSpace(' ') PsiErrorElement:Annotations are not allowed in this position ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -69,6 +70,7 @@ JetFile: Properties.kt PsiWhiteSpace(' ') PsiErrorElement:Annotations are not allowed in this position ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/PropertiesFollowedByInitializers.kt b/compiler/testData/psi/PropertiesFollowedByInitializers.kt index 93fd66d0437..042ca546582 100644 --- a/compiler/testData/psi/PropertiesFollowedByInitializers.kt +++ b/compiler/testData/psi/PropertiesFollowedByInitializers.kt @@ -13,8 +13,8 @@ class Foo() { } var b5 : Int get abstract set - var b6 : Int get [a] abstract set - var b7 : Int get [a] abstract {} + var b6 : Int get @[a] abstract set + var b7 : Int get @[a] abstract {} var b8 : Int get @a abstract set var b9 : Int get @a abstract {} } diff --git a/compiler/testData/psi/PropertiesFollowedByInitializers.txt b/compiler/testData/psi/PropertiesFollowedByInitializers.txt index 416c2623610..7830559d09d 100644 --- a/compiler/testData/psi/PropertiesFollowedByInitializers.txt +++ b/compiler/testData/psi/PropertiesFollowedByInitializers.txt @@ -227,6 +227,7 @@ JetFile: PropertiesFollowedByInitializers.kt PROPERTY_ACCESSOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -256,6 +257,7 @@ JetFile: PropertiesFollowedByInitializers.kt PsiElement(get)('get') PsiWhiteSpace(' ') PsiErrorElement:Property getter or setter expected + PsiElement(AT)('@') PsiElement(LBRACKET)('[') PsiElement(IDENTIFIER)('a') PsiElement(RBRACKET)(']') diff --git a/compiler/testData/psi/Properties_ERR.kt b/compiler/testData/psi/Properties_ERR.kt index b78f628ffa9..8cab3b2b6f8 100644 --- a/compiler/testData/psi/Properties_ERR.kt +++ b/compiler/testData/psi/Properties_ERR.kt @@ -4,10 +4,10 @@ var f : val foo : val : val : Int -val [a foo = foo +val @[a foo = foo val foo.bar. val foo. -val [a] foo : = bar +val @a foo : = bar val foo.bar public () {} () = foo diff --git a/compiler/testData/psi/Properties_ERR.txt b/compiler/testData/psi/Properties_ERR.txt index ecb22594cae..8160c281c03 100644 --- a/compiler/testData/psi/Properties_ERR.txt +++ b/compiler/testData/psi/Properties_ERR.txt @@ -79,6 +79,7 @@ JetFile: Properties_ERR.kt PsiWhiteSpace(' ') PsiErrorElement:Annotations are not allowed in this position ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -131,15 +132,13 @@ JetFile: Properties_ERR.kt PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Annotations are not allowed in this position - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/QuotedIdentifiers.kt b/compiler/testData/psi/QuotedIdentifiers.kt index 35382188e82..279c0a6b58d 100644 --- a/compiler/testData/psi/QuotedIdentifiers.kt +++ b/compiler/testData/psi/QuotedIdentifiers.kt @@ -1,4 +1,4 @@ -[`return`] fun `package`() { +@`return` fun `package`() { `class`() } diff --git a/compiler/testData/psi/QuotedIdentifiers.txt b/compiler/testData/psi/QuotedIdentifiers.txt index fed9cdfb7b3..667b2ca480f 100644 --- a/compiler/testData/psi/QuotedIdentifiers.txt +++ b/compiler/testData/psi/QuotedIdentifiers.txt @@ -5,15 +5,13 @@ JetFile: QuotedIdentifiers.kt FUN MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('`return`') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('`return`') PsiWhiteSpace(' ') PsiElement(fun)('fun') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/TypeParametersBeforeName.kt b/compiler/testData/psi/TypeParametersBeforeName.kt index da3fe47f5b4..74b8157173c 100644 --- a/compiler/testData/psi/TypeParametersBeforeName.kt +++ b/compiler/testData/psi/TypeParametersBeforeName.kt @@ -1,6 +1,6 @@ fun foo() -fun [a] foo() -fun [a] T.foo() +fun @[a] foo() +fun @[a] T.foo() val List.foo var List.foo \ No newline at end of file diff --git a/compiler/testData/psi/TypeParametersBeforeName.txt b/compiler/testData/psi/TypeParametersBeforeName.txt index 0708a75edb2..7f5f37e1609 100644 --- a/compiler/testData/psi/TypeParametersBeforeName.txt +++ b/compiler/testData/psi/TypeParametersBeforeName.txt @@ -36,6 +36,7 @@ JetFile: TypeParametersBeforeName.kt PsiWhiteSpace(' ') PsiErrorElement:Annotations are not allowed in this position ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -65,6 +66,7 @@ JetFile: TypeParametersBeforeName.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/AnnotatedExpressions.kt b/compiler/testData/psi/annotation/AnnotatedExpressions.kt index 062e2db0602..713352d2852 100644 --- a/compiler/testData/psi/annotation/AnnotatedExpressions.kt +++ b/compiler/testData/psi/annotation/AnnotatedExpressions.kt @@ -1,5 +1,5 @@ fun foo() { - [a] foo + @[a] foo 1 - [a] this + @[a] this } diff --git a/compiler/testData/psi/annotation/AnnotatedExpressions.txt b/compiler/testData/psi/annotation/AnnotatedExpressions.txt index b395b5d4b5d..3a348f8a1d1 100644 --- a/compiler/testData/psi/annotation/AnnotatedExpressions.txt +++ b/compiler/testData/psi/annotation/AnnotatedExpressions.txt @@ -16,6 +16,7 @@ JetFile: AnnotatedExpressions.kt PsiWhiteSpace('\n ') ANNOTATED_EXPRESSION ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -33,6 +34,7 @@ JetFile: AnnotatedExpressions.kt PsiWhiteSpace('\n ') ANNOTATED_EXPRESSION ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/Annotations.kt b/compiler/testData/psi/annotation/Annotations.kt index 2cf3b445414..5acb371bf14 100644 --- a/compiler/testData/psi/annotation/Annotations.kt +++ b/compiler/testData/psi/annotation/Annotations.kt @@ -12,24 +12,24 @@ private protected public internal -[foo(a, b) ina foo.bar.goo.doo.foo.foo] -[df] +@[foo(a, b) ina foo.bar.goo.doo.foo.foo] +@[df] in -[sdfsdf] +@[sdfsdf] out ref class Bar d + is @[a] T -> d } } diff --git a/compiler/testData/psi/annotation/AnnotationsOnPatterns.txt b/compiler/testData/psi/annotation/AnnotationsOnPatterns.txt index 04893c117c7..b6d72a09ac7 100644 --- a/compiler/testData/psi/annotation/AnnotationsOnPatterns.txt +++ b/compiler/testData/psi/annotation/AnnotationsOnPatterns.txt @@ -30,6 +30,7 @@ JetFile: AnnotationsOnPatterns.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/Annotations_ERR.kt b/compiler/testData/psi/annotation/Annotations_ERR.kt index 7bc5aaa1e14..3cd5c4bb069 100644 --- a/compiler/testData/psi/annotation/Annotations_ERR.kt +++ b/compiler/testData/psi/annotation/Annotations_ERR.kt @@ -8,16 +8,16 @@ annotation override open abstract -[] +@[] private protected public internal -[foo(a, b), ina foo.bar.goo.doo.foo.foo] -[df] +@[foo(a, b), ina foo.bar.goo.doo.foo.foo] +@[df] in -[sdfsdf ] -[s fd d, ] +@[sdfsdf ] +@[s fd d, ] out ref class Bar @@ -48,6 +49,7 @@ JetFile: Annotations_ERR.kt PsiElement(internal)('internal') PsiWhiteSpace('\n') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -143,6 +145,7 @@ JetFile: Annotations_ERR.kt PsiElement(RBRACKET)(']') PsiWhiteSpace('\n') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -155,6 +158,7 @@ JetFile: Annotations_ERR.kt PsiElement(in)('in') PsiWhiteSpace('\n') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -166,6 +170,7 @@ JetFile: Annotations_ERR.kt PsiElement(RBRACKET)(']') PsiWhiteSpace('\n') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -225,6 +230,7 @@ JetFile: Annotations_ERR.kt PsiElement(abstract)('abstract') PsiWhiteSpace('\n') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/TypeAnnotations.kt b/compiler/testData/psi/annotation/TypeAnnotations.kt index c876c590ea9..d6644f94609 100644 --- a/compiler/testData/psi/annotation/TypeAnnotations.kt +++ b/compiler/testData/psi/annotation/TypeAnnotations.kt @@ -1,5 +1,5 @@ -class F(a : [a] [b] B) +class F(a : @[a] @[b] B) -typealias f = [b] [x] F<[x] A, B> +typealias f = @[b] @[x] F<@[x] A, B> -class C : [a] B, [c d] E by F, [g] H(), [i] () -> Unit +class C : @[a] B, @[c d] E by F, @[g] H(), @[i] () -> Unit diff --git a/compiler/testData/psi/annotation/TypeAnnotations.txt b/compiler/testData/psi/annotation/TypeAnnotations.txt index c4ff6c237dd..538d5ddfe9a 100644 --- a/compiler/testData/psi/annotation/TypeAnnotations.txt +++ b/compiler/testData/psi/annotation/TypeAnnotations.txt @@ -17,6 +17,7 @@ JetFile: TypeAnnotations.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -27,6 +28,7 @@ JetFile: TypeAnnotations.kt PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -50,6 +52,7 @@ JetFile: TypeAnnotations.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -60,6 +63,7 @@ JetFile: TypeAnnotations.kt PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -77,6 +81,7 @@ JetFile: TypeAnnotations.kt TYPE_PROJECTION MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -110,6 +115,7 @@ JetFile: TypeAnnotations.kt DELEGATOR_SUPER_CLASS TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -127,6 +133,7 @@ JetFile: TypeAnnotations.kt DELEGATOR_BY TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -157,6 +164,7 @@ JetFile: TypeAnnotations.kt CONSTRUCTOR_CALLEE TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -177,6 +185,7 @@ JetFile: TypeAnnotations.kt DELEGATOR_SUPER_CLASS TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/at/declarationsJustAtTyped.kt b/compiler/testData/psi/annotation/at/declarationsJustAtTyped.kt index 4970dc204ad..9ceaccfbc03 100644 --- a/compiler/testData/psi/annotation/at/declarationsJustAtTyped.kt +++ b/compiler/testData/psi/annotation/at/declarationsJustAtTyped.kt @@ -1,4 +1,4 @@ -private @ [Ann1(1)] Ann3("2") class A( +private @ @[Ann1(1)] Ann3("2") class A( @ private val x: Int, @ private var y: Int, @ open z: Int @@ -10,10 +10,10 @@ private @ [Ann1(1)] Ann3("2") class A( @ - [inline2] private + @[inline2] private fun inlineLocal() {} - [Ann] + @[Ann] private @ @volatile var x = 1 diff --git a/compiler/testData/psi/annotation/at/declarationsJustAtTyped.txt b/compiler/testData/psi/annotation/at/declarationsJustAtTyped.txt index 7031b005b86..a726cc04ff2 100644 --- a/compiler/testData/psi/annotation/at/declarationsJustAtTyped.txt +++ b/compiler/testData/psi/annotation/at/declarationsJustAtTyped.txt @@ -11,6 +11,7 @@ JetFile: declarationsJustAtTyped.kt PsiElement(AT)('@') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -145,6 +146,7 @@ JetFile: declarationsJustAtTyped.kt PsiElement(AT)('@') PsiWhiteSpace('\n\n ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -170,6 +172,7 @@ JetFile: declarationsJustAtTyped.kt PROPERTY MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/at/enumEntries.kt b/compiler/testData/psi/annotation/at/enumEntries.kt index 8492e3c3b9c..1c294667f6b 100644 --- a/compiler/testData/psi/annotation/at/enumEntries.kt +++ b/compiler/testData/psi/annotation/at/enumEntries.kt @@ -1,5 +1,5 @@ enum class A { - [Ann] @Ann(1) X : A() + @[Ann] @Ann(1) X : A() @Ann Y : A() {} diff --git a/compiler/testData/psi/annotation/at/enumEntries.txt b/compiler/testData/psi/annotation/at/enumEntries.txt index b23acf3a0ab..8d23e4fde86 100644 --- a/compiler/testData/psi/annotation/at/enumEntries.txt +++ b/compiler/testData/psi/annotation/at/enumEntries.txt @@ -17,6 +17,7 @@ JetFile: enumEntries.kt ENUM_ENTRY MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/at/primaryConstructor.kt b/compiler/testData/psi/annotation/at/primaryConstructor.kt index dc46f976430..69142b77086 100644 --- a/compiler/testData/psi/annotation/at/primaryConstructor.kt +++ b/compiler/testData/psi/annotation/at/primaryConstructor.kt @@ -3,7 +3,7 @@ class A1 @Ann1("") () class A2 @Ann2("")(x: Int) : B { } -class A3 [Ann3] private @(x: Int) -class A4 [Ann4] @private @(x: Int) +class A3 @[Ann3] private @(x: Int) +class A4 @[Ann4] @private @(x: Int) class A5 private @Ann4(x: Int) : B -class A6 [Ann5] @private @ [Ann6]() +class A6 @[Ann5] @private @ @[Ann6]() diff --git a/compiler/testData/psi/annotation/at/primaryConstructor.txt b/compiler/testData/psi/annotation/at/primaryConstructor.txt index d966f6d8617..35f63d03649 100644 --- a/compiler/testData/psi/annotation/at/primaryConstructor.txt +++ b/compiler/testData/psi/annotation/at/primaryConstructor.txt @@ -84,6 +84,7 @@ JetFile: primaryConstructor.kt PRIMARY_CONSTRUCTOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -117,6 +118,7 @@ JetFile: primaryConstructor.kt PRIMARY_CONSTRUCTOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -192,6 +194,7 @@ JetFile: primaryConstructor.kt PRIMARY_CONSTRUCTOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -207,6 +210,7 @@ JetFile: primaryConstructor.kt PsiElement(AT)('@') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -217,4 +221,4 @@ JetFile: primaryConstructor.kt PsiElement(RBRACKET)(']') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/annotation/at/validDeclarations.kt b/compiler/testData/psi/annotation/at/validDeclarations.kt index d0da076a65d..c0bc62c54cf 100644 --- a/compiler/testData/psi/annotation/at/validDeclarations.kt +++ b/compiler/testData/psi/annotation/at/validDeclarations.kt @@ -1,19 +1,19 @@ -private @open [Ann1(1)] @Ann2("1") Ann3("2") class A( +private @open @[Ann1(1)] @Ann2("1") Ann3("2") class A( @volatile(1) private val x: @AnnType("3") @open Int, @private var y: Int, @open z: Int ) { - @private [Ann3(2)] @Ann4("4") fun foo() { + @private @[Ann3(2)] @Ann4("4") fun foo() { @data class LocalClass print(1) @inline(option1, option2) - [inline2] private + @[inline2] private fun inlineLocal() {} - [Ann] + @[Ann] private @abstract @volatile var x = 1 @@ -22,7 +22,7 @@ private @open [Ann1(1)] @Ann2("1") Ann3("2") class A( } val x: Int - @inject [inline] private @open get() = 1 + @inject @[inline] private @open get() = 1 @open @ann init {} @@ -35,7 +35,7 @@ private @open [Ann1(1)] @Ann2("1") Ann3("2") class A( @private constructor() - fun <@ann("") [ann] T : R> foo() {} + fun <@ann("") @[ann] T : R> foo() {} } @private val x = 1 diff --git a/compiler/testData/psi/annotation/at/validDeclarations.txt b/compiler/testData/psi/annotation/at/validDeclarations.txt index 730a76f2684..30c96bc6e68 100644 --- a/compiler/testData/psi/annotation/at/validDeclarations.txt +++ b/compiler/testData/psi/annotation/at/validDeclarations.txt @@ -10,6 +10,7 @@ JetFile: validDeclarations.kt PsiElement(open)('@open') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -156,6 +157,7 @@ JetFile: validDeclarations.kt PsiElement(private)('@private') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -244,6 +246,7 @@ JetFile: validDeclarations.kt PsiElement(RPAR)(')') PsiWhiteSpace('\n\n ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -269,6 +272,7 @@ JetFile: validDeclarations.kt PROPERTY MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -365,6 +369,7 @@ JetFile: validDeclarations.kt PsiElement(IDENTIFIER)('inject') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -466,6 +471,7 @@ JetFile: validDeclarations.kt PsiElement(RPAR)(')') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/at/validExpressions.kt b/compiler/testData/psi/annotation/at/validExpressions.kt index dba392b3c53..8fbde811c18 100644 --- a/compiler/testData/psi/annotation/at/validExpressions.kt +++ b/compiler/testData/psi/annotation/at/validExpressions.kt @@ -25,7 +25,7 @@ fun foo() { label@simpleName - val x = @ann [ann] l@{ + val x = @ann @[ann] l@{ a, b, c -> a } } diff --git a/compiler/testData/psi/annotation/at/validExpressions.txt b/compiler/testData/psi/annotation/at/validExpressions.txt index 9f05391f1b5..9c962ce7c36 100644 --- a/compiler/testData/psi/annotation/at/validExpressions.txt +++ b/compiler/testData/psi/annotation/at/validExpressions.txt @@ -336,6 +336,7 @@ JetFile: validExpressions.kt PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/forParameters.kt b/compiler/testData/psi/annotation/forParameters.kt index e41b3e611de..874b59d1e2d 100644 --- a/compiler/testData/psi/annotation/forParameters.kt +++ b/compiler/testData/psi/annotation/forParameters.kt @@ -1,12 +1,12 @@ fun foo() { for (@volatile x in z) {} - for ([ann]) {} + for (@[ann]) {} for (@ in z) {} - for ((x, private data @ann [ann] y) in x) {} + for ((x, private data @ann @[ann] y) in x) {} - for (([ann], x) in pair) {} + for ((@[ann], x) in pair) {} for (volatile x in 1..100) {} for (volatile(1) x in 1..100) {} diff --git a/compiler/testData/psi/annotation/forParameters.txt b/compiler/testData/psi/annotation/forParameters.txt index 56b01459e7c..99e7dc727f3 100644 --- a/compiler/testData/psi/annotation/forParameters.txt +++ b/compiler/testData/psi/annotation/forParameters.txt @@ -49,6 +49,7 @@ JetFile: forParameters.kt VALUE_PARAMETER MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -124,6 +125,7 @@ JetFile: forParameters.kt PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -157,6 +159,7 @@ JetFile: forParameters.kt MULTI_VARIABLE_DECLARATION_ENTRY MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/lambda.kt b/compiler/testData/psi/annotation/lambda.kt index 796e2d8bf08..75d5cf1cc88 100644 --- a/compiler/testData/psi/annotation/lambda.kt +++ b/compiler/testData/psi/annotation/lambda.kt @@ -7,7 +7,7 @@ fun foo() { print(2) } - bar @ann [ann] { + bar @ann @[ann] { print(2) } @@ -15,11 +15,11 @@ fun foo() { print(1) } - bar() [ann] { + bar() @[ann] { print(2) } - bar() @ann [ann] { + bar() @ann @[ann] { print(2) } @@ -30,7 +30,7 @@ fun foo() { if (true) @ann { } - else [ann] @ann { + else @[ann] @ann { } diff --git a/compiler/testData/psi/annotation/lambda.txt b/compiler/testData/psi/annotation/lambda.txt index 761fb7d1260..2ef9a899f91 100644 --- a/compiler/testData/psi/annotation/lambda.txt +++ b/compiler/testData/psi/annotation/lambda.txt @@ -91,6 +91,7 @@ JetFile: lambda.kt PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -161,6 +162,7 @@ JetFile: lambda.kt FUNCTION_LITERAL_ARGUMENT ANNOTATED_EXPRESSION ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -205,6 +207,7 @@ JetFile: lambda.kt PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -292,6 +295,7 @@ JetFile: lambda.kt ELSE ANNOTATED_EXPRESSION ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/lambdaRecovery.kt b/compiler/testData/psi/annotation/lambdaRecovery.kt index cda4eea9b97..e3ef70804f3 100644 --- a/compiler/testData/psi/annotation/lambdaRecovery.kt +++ b/compiler/testData/psi/annotation/lambdaRecovery.kt @@ -7,7 +7,7 @@ fun foo() { print(1) } - bar @ [ann] { + bar @ @[ann] { print(2) } @@ -19,7 +19,7 @@ fun foo() { print(1) } - bar() [] @ { + bar() @[] @ { print(2) } @@ -34,7 +34,7 @@ fun foo() { if (true) @ { } - else [ann] @ ann { + else @[ann] @ ann { } } diff --git a/compiler/testData/psi/annotation/lambdaRecovery.txt b/compiler/testData/psi/annotation/lambdaRecovery.txt index 338faa9b98b..394503c7e59 100644 --- a/compiler/testData/psi/annotation/lambdaRecovery.txt +++ b/compiler/testData/psi/annotation/lambdaRecovery.txt @@ -75,6 +75,7 @@ JetFile: lambdaRecovery.kt PsiElement(AT)('@') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -173,6 +174,7 @@ JetFile: lambdaRecovery.kt FUNCTION_LITERAL_ARGUMENT ANNOTATED_EXPRESSION ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') PsiErrorElement:Expecting a list of annotations @@ -281,6 +283,7 @@ JetFile: lambdaRecovery.kt ELSE ANNOTATED_EXPRESSION ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -306,4 +309,4 @@ JetFile: lambdaRecovery.kt PsiElement(RBRACE)('}') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/annotation/multiDeclaration.kt b/compiler/testData/psi/annotation/multiDeclaration.kt index ebd0c8dfa88..c130a84a430 100644 --- a/compiler/testData/psi/annotation/multiDeclaration.kt +++ b/compiler/testData/psi/annotation/multiDeclaration.kt @@ -1,6 +1,6 @@ fun foo() { - val (x, private data @ann [ann] y) = pair - val ([ann], x) = pair + val (x, private data @ann @[ann] y) = pair + val (@[ann], x) = pair @volatile val (@ann x, y) = 1 @volatile val (@ann x, y = 1 diff --git a/compiler/testData/psi/annotation/multiDeclaration.txt b/compiler/testData/psi/annotation/multiDeclaration.txt index d96f363aadb..ecb1eeefe0e 100644 --- a/compiler/testData/psi/annotation/multiDeclaration.txt +++ b/compiler/testData/psi/annotation/multiDeclaration.txt @@ -42,6 +42,7 @@ JetFile: multiDeclaration.kt PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -66,6 +67,7 @@ JetFile: multiDeclaration.kt MULTI_VARIABLE_DECLARATION_ENTRY MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/annotation/oldAnnotationsRecovery.kt b/compiler/testData/psi/annotation/oldAnnotationsRecovery.kt new file mode 100644 index 00000000000..1f527426abb --- /dev/null +++ b/compiler/testData/psi/annotation/oldAnnotationsRecovery.kt @@ -0,0 +1,9 @@ +[data(1)] class A { + fun foo() { + [inline] fun bar() { + return 1 + } + + [suppress("1")] 1+1 + } +} diff --git a/compiler/testData/psi/annotation/oldAnnotationsRecovery.txt b/compiler/testData/psi/annotation/oldAnnotationsRecovery.txt new file mode 100644 index 00000000000..868086ec147 --- /dev/null +++ b/compiler/testData/psi/annotation/oldAnnotationsRecovery.txt @@ -0,0 +1,92 @@ +JetFile: oldAnnotationsRecovery.kt + PACKAGE_DIRECTIVE + + IMPORT_LIST + + PsiErrorElement:Expecting a top level declaration + PsiElement(LBRACKET)('[') + MODIFIER_LIST + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('data') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') + PsiErrorElement:Expecting a top level declaration + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('A') + PsiWhiteSpace(' ') + CLASS_BODY + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + FUN + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('foo') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + BLOCK + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + PsiErrorElement:Expecting an element + PsiElement(LBRACKET)('[') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('inline') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(fun)('fun') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('bar') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + PsiWhiteSpace('\n ') + BLOCK + RETURN + PsiElement(return)('return') + PsiWhiteSpace(' ') + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n\n ') + PsiErrorElement:Expecting an element + PsiElement(LBRACKET)('[') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('suppress') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('1') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(RPAR)(')') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + PsiElement(INTEGER_LITERAL)('1') + PsiElement(PLUS)('+') + PsiElement(INTEGER_LITERAL)('1') + PsiWhiteSpace('\n ') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/annotation/onFileObsolete/fileAnnotationInWrongPlace.kt b/compiler/testData/psi/annotation/onFileObsolete/fileAnnotationInWrongPlace.kt deleted file mode 100644 index 06e3f41875f..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/fileAnnotationInWrongPlace.kt +++ /dev/null @@ -1,13 +0,0 @@ -package bar - -[file: foo] -val prop - -[file:bar baz] -fun func() {} - -[file:baz] -class C - -[file:] -interface T diff --git a/compiler/testData/psi/annotation/onFileObsolete/fileAnnotationInWrongPlace.txt b/compiler/testData/psi/annotation/onFileObsolete/fileAnnotationInWrongPlace.txt deleted file mode 100644 index d08191aa3db..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/fileAnnotationInWrongPlace.txt +++ /dev/null @@ -1,95 +0,0 @@ -JetFile: fileAnnotationInWrongPlace.kt - PACKAGE_DIRECTIVE - PsiElement(package)('package') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - IMPORT_LIST - - PsiWhiteSpace('\n\n') - PROPERTY - MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiErrorElement:File annotations are only allowed before package declaration - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('prop') - PsiWhiteSpace('\n\n') - FUN - MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiErrorElement:File annotations are only allowed before package declaration - PsiElement(file)('file') - PsiElement(COLON)(':') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('baz') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('func') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - BLOCK - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiErrorElement:File annotations are only allowed before package declaration - PsiElement(file)('file') - PsiElement(COLON)(':') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('baz') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('C') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiErrorElement:File annotations are only allowed before package declaration - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiErrorElement:Expecting a list of annotations - - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PsiElement(interface)('interface') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('T') diff --git a/compiler/testData/psi/annotation/onFileObsolete/manyAnnotationBlocks.kt b/compiler/testData/psi/annotation/onFileObsolete/manyAnnotationBlocks.kt deleted file mode 100644 index bfb1ddc8b8d..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/manyAnnotationBlocks.kt +++ /dev/null @@ -1,3 +0,0 @@ -[file: foo] -[file:bar baz] -package bar diff --git a/compiler/testData/psi/annotation/onFileObsolete/manyAnnotationBlocks.txt b/compiler/testData/psi/annotation/onFileObsolete/manyAnnotationBlocks.txt deleted file mode 100644 index 7fa8d7d5730..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/manyAnnotationBlocks.txt +++ /dev/null @@ -1,41 +0,0 @@ -JetFile: manyAnnotationBlocks.kt - FILE_ANNOTATION_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiElement(COLON)(':') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('baz') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PACKAGE_DIRECTIVE - PsiElement(package)('package') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - IMPORT_LIST - \ No newline at end of file diff --git a/compiler/testData/psi/annotation/onFileObsolete/manyInOneAnnotationBlock.kt b/compiler/testData/psi/annotation/onFileObsolete/manyInOneAnnotationBlock.kt deleted file mode 100644 index 65623326763..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/manyInOneAnnotationBlock.kt +++ /dev/null @@ -1,3 +0,0 @@ -[file: foo bar -baz] -package bar diff --git a/compiler/testData/psi/annotation/onFileObsolete/manyInOneAnnotationBlock.txt b/compiler/testData/psi/annotation/onFileObsolete/manyInOneAnnotationBlock.txt deleted file mode 100644 index e0b03c62d92..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/manyInOneAnnotationBlock.txt +++ /dev/null @@ -1,36 +0,0 @@ -JetFile: manyInOneAnnotationBlock.kt - FILE_ANNOTATION_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('baz') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PACKAGE_DIRECTIVE - PsiElement(package)('package') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - IMPORT_LIST - \ No newline at end of file diff --git a/compiler/testData/psi/annotation/onFileObsolete/nonFIleAnnotationBeforePackage.kt b/compiler/testData/psi/annotation/onFileObsolete/nonFIleAnnotationBeforePackage.kt deleted file mode 100644 index 563b148f895..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/nonFIleAnnotationBeforePackage.kt +++ /dev/null @@ -1,8 +0,0 @@ -[foo] -[file bar] -[file, baz] -[file] -[:foo.bar] -[file:] -[:] -package boo diff --git a/compiler/testData/psi/annotation/onFileObsolete/nonFIleAnnotationBeforePackage.txt b/compiler/testData/psi/annotation/onFileObsolete/nonFIleAnnotationBeforePackage.txt deleted file mode 100644 index 542ceef7128..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/nonFIleAnnotationBeforePackage.txt +++ /dev/null @@ -1,88 +0,0 @@ -JetFile: nonFIleAnnotationBeforePackage.kt - FILE_ANNOTATION_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiErrorElement:Expecting "file:" prefix for file annotations - - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiErrorElement:Expecting "file:" prefix for file annotations - - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiErrorElement:Expecting "file:" prefix for file annotations - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('baz') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiErrorElement:Expecting "file:" prefix for file annotations - - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - ANNOTATION - PsiElement(LBRACKET)('[') - PsiErrorElement:Expected 'file' keyword before ':' - PsiElement(COLON)(':') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiErrorElement:Expecting a list of annotations - - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - ANNOTATION - PsiElement(LBRACKET)('[') - PsiErrorElement:Expected 'file' keyword before ':' - PsiElement(COLON)(':') - PsiErrorElement:Expecting a list of annotations - - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PACKAGE_DIRECTIVE - PsiElement(package)('package') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('boo') - IMPORT_LIST - \ No newline at end of file diff --git a/compiler/testData/psi/annotation/onFileObsolete/single.kt b/compiler/testData/psi/annotation/onFileObsolete/single.kt deleted file mode 100644 index 80c13d85fb9..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/single.kt +++ /dev/null @@ -1,2 +0,0 @@ -[file: foo] -package bar diff --git a/compiler/testData/psi/annotation/onFileObsolete/single.txt b/compiler/testData/psi/annotation/onFileObsolete/single.txt deleted file mode 100644 index 06c93789e54..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/single.txt +++ /dev/null @@ -1,22 +0,0 @@ -JetFile: single.kt - FILE_ANNOTATION_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PACKAGE_DIRECTIVE - PsiElement(package)('package') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - IMPORT_LIST - \ No newline at end of file diff --git a/compiler/testData/psi/annotation/onFileObsolete/withoutFileAnnotationAndPackageDeclaration.kt b/compiler/testData/psi/annotation/onFileObsolete/withoutFileAnnotationAndPackageDeclaration.kt deleted file mode 100644 index d4c79c5a846..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/withoutFileAnnotationAndPackageDeclaration.kt +++ /dev/null @@ -1,3 +0,0 @@ -[ann] fun foo(): String? = null - -annotation class ann diff --git a/compiler/testData/psi/annotation/onFileObsolete/withoutFileAnnotationAndPackageDeclaration.txt b/compiler/testData/psi/annotation/onFileObsolete/withoutFileAnnotationAndPackageDeclaration.txt deleted file mode 100644 index 4ede5dbfe69..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/withoutFileAnnotationAndPackageDeclaration.txt +++ /dev/null @@ -1,44 +0,0 @@ -JetFile: withoutFileAnnotationAndPackageDeclaration.kt - PACKAGE_DIRECTIVE - - IMPORT_LIST - - FUN - MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('ann') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - NULLABLE_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('String') - PsiElement(QUEST)('?') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - NULL - PsiElement(null)('null') - PsiWhiteSpace('\n\n') - CLASS - MODIFIER_LIST - PsiElement(annotation)('annotation') - PsiWhiteSpace(' ') - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('ann') diff --git a/compiler/testData/psi/annotation/onFileObsolete/withoutPackage.kt b/compiler/testData/psi/annotation/onFileObsolete/withoutPackage.kt deleted file mode 100644 index 979db5a485e..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/withoutPackage.kt +++ /dev/null @@ -1,4 +0,0 @@ -[file: foo] -[foo bar] -[file: baz] -fun foo() {} diff --git a/compiler/testData/psi/annotation/onFileObsolete/withoutPackage.txt b/compiler/testData/psi/annotation/onFileObsolete/withoutPackage.txt deleted file mode 100644 index 0f466d01820..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/withoutPackage.txt +++ /dev/null @@ -1,62 +0,0 @@ -JetFile: withoutPackage.kt - FILE_ANNOTATION_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') - PACKAGE_DIRECTIVE - - IMPORT_LIST - - PsiWhiteSpace('\n') - FUN - MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - ANNOTATION - PsiElement(LBRACKET)('[') - PsiErrorElement:File annotations are only allowed before package declaration - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('baz') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - BLOCK - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') diff --git a/compiler/testData/psi/annotation/onFileObsolete/withoutPackageWithSimpleAnnotation.kt b/compiler/testData/psi/annotation/onFileObsolete/withoutPackageWithSimpleAnnotation.kt deleted file mode 100644 index 074b57d44f3..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/withoutPackageWithSimpleAnnotation.kt +++ /dev/null @@ -1,4 +0,0 @@ -[file: foo] -foo bar -[file: baz] -fun foo() {} diff --git a/compiler/testData/psi/annotation/onFileObsolete/withoutPackageWithSimpleAnnotation.txt b/compiler/testData/psi/annotation/onFileObsolete/withoutPackageWithSimpleAnnotation.txt deleted file mode 100644 index d8dfd73b548..00000000000 --- a/compiler/testData/psi/annotation/onFileObsolete/withoutPackageWithSimpleAnnotation.txt +++ /dev/null @@ -1,59 +0,0 @@ -JetFile: withoutPackageWithSimpleAnnotation.kt - FILE_ANNOTATION_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RBRACKET)(']') - PACKAGE_DIRECTIVE - - IMPORT_LIST - - PsiWhiteSpace('\n') - FUN - MODIFIER_LIST - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('bar') - PsiWhiteSpace('\n') - ANNOTATION - PsiElement(LBRACKET)('[') - PsiErrorElement:File annotations are only allowed before package declaration - PsiElement(file)('file') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('baz') - PsiElement(RBRACKET)(']') - PsiWhiteSpace('\n') - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - BLOCK - PsiElement(LBRACE)('{') - PsiElement(RBRACE)('}') diff --git a/compiler/testData/psi/examples/BinaryTree.kt b/compiler/testData/psi/examples/BinaryTree.kt index ef07d13acba..5685cc9ea8b 100644 --- a/compiler/testData/psi/examples/BinaryTree.kt +++ b/compiler/testData/psi/examples/BinaryTree.kt @@ -20,7 +20,7 @@ class BinaryTree : IMutableSet { constructor() : this(naturalOrder()) { } - private [operator] fun T.compareTo(other : T) : Int = compare(this, other) + private @[operator] fun T.compareTo(other : T) : Int = compare(this, other) override fun contains(item : T) : Boolean { return contains(root, item) diff --git a/compiler/testData/psi/examples/BinaryTree.txt b/compiler/testData/psi/examples/BinaryTree.txt index 95f7dcbbe15..58d352f8f93 100644 --- a/compiler/testData/psi/examples/BinaryTree.txt +++ b/compiler/testData/psi/examples/BinaryTree.txt @@ -246,6 +246,7 @@ JetFile: BinaryTree.kt PsiElement(private)('private') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/examples/BitArith.kt b/compiler/testData/psi/examples/BitArith.kt index 3bd6f14fa8a..6587c7687a8 100644 --- a/compiler/testData/psi/examples/BitArith.kt +++ b/compiler/testData/psi/examples/BitArith.kt @@ -23,7 +23,7 @@ fun Int.matchMask(mask : Int) = this and mask == mask open class INumber : IComparable { val bits : Int - [operator] fun plus(other : This) : This - [operator] fun shl(bits : Int) : This + @operator fun plus(other : This) : This + @operator fun shl(bits : Int) : This // ... } \ No newline at end of file diff --git a/compiler/testData/psi/examples/BitArith.txt b/compiler/testData/psi/examples/BitArith.txt index 019b8cb27d3..1ec047b087f 100644 --- a/compiler/testData/psi/examples/BitArith.txt +++ b/compiler/testData/psi/examples/BitArith.txt @@ -557,15 +557,13 @@ JetFile: BitArith.kt PsiWhiteSpace('\n ') FUN MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('operator') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('operator') PsiWhiteSpace(' ') PsiElement(fun)('fun') PsiWhiteSpace(' ') @@ -590,15 +588,13 @@ JetFile: BitArith.kt PsiWhiteSpace('\n ') FUN MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('operator') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('operator') PsiWhiteSpace(' ') PsiElement(fun)('fun') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/examples/Builder.kt b/compiler/testData/psi/examples/Builder.kt index 6f7b80c32b8..b7cc2ad54b0 100644 --- a/compiler/testData/psi/examples/Builder.kt +++ b/compiler/testData/psi/examples/Builder.kt @@ -1,16 +1,16 @@ val foo = object : AntBuilder() { - [lazy] val groovy = library { + @lazy val groovy = library { classpath("$libs/groovy-...") } - [lazy] val gant = library { + @lazy val gant = library { File("$gantHome/lib").files.each { classpath(it) } } - [lazy] val JPS = module { + @lazy val JPS = module { targetLevel = "1.5" classpath(antLayout, gant, groovy) src("$projectHome/antLayout/src") diff --git a/compiler/testData/psi/examples/Builder.txt b/compiler/testData/psi/examples/Builder.txt index 6eb739f7bbd..ae9cb3d70d5 100644 --- a/compiler/testData/psi/examples/Builder.txt +++ b/compiler/testData/psi/examples/Builder.txt @@ -33,15 +33,13 @@ JetFile: Builder.kt PsiWhiteSpace('\n\n ') PROPERTY MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('lazy') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('lazy') PsiWhiteSpace(' ') PsiElement(val)('val') PsiWhiteSpace(' ') @@ -80,15 +78,13 @@ JetFile: Builder.kt PsiWhiteSpace('\n\n ') PROPERTY MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('lazy') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('lazy') PsiWhiteSpace(' ') PsiElement(val)('val') PsiWhiteSpace(' ') @@ -154,15 +150,13 @@ JetFile: Builder.kt PsiWhiteSpace('\n\n ') PROPERTY MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('lazy') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('lazy') PsiWhiteSpace(' ') PsiElement(val)('val') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/examples/With.kt b/compiler/testData/psi/examples/With.kt index c6bf6fa33e2..63968e41fc0 100644 --- a/compiler/testData/psi/examples/With.kt +++ b/compiler/testData/psi/examples/With.kt @@ -1,4 +1,4 @@ -[inline] fun with(receiver : T, body : T.() -> Unit) = receiver.body() +inline fun with(receiver : T, body : T.() -> Unit) = receiver.body() fun example() { diff --git a/compiler/testData/psi/examples/With.txt b/compiler/testData/psi/examples/With.txt index 37f11f93e73..c2a73f94034 100644 --- a/compiler/testData/psi/examples/With.txt +++ b/compiler/testData/psi/examples/With.txt @@ -5,15 +5,12 @@ JetFile: With.kt FUN MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('inline') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('inline') PsiWhiteSpace(' ') PsiElement(fun)('fun') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/examples/array/MutableArray.kt b/compiler/testData/psi/examples/array/MutableArray.kt index cb270fa33a8..48184aa7be2 100644 --- a/compiler/testData/psi/examples/array/MutableArray.kt +++ b/compiler/testData/psi/examples/array/MutableArray.kt @@ -3,11 +3,11 @@ */ open class ReadOnlyArray : ISized { - [operator] fun get(index : Int) : T + @[operator] fun get(index : Int) : T } open class WriteOnlyArray : ISized { // This is needed to keep IIterator's covariant - [operator] fun set(index : Int, value : T) + @[operator] fun set(index : Int, value : T) } class MutableArray : ReadOnlyArray, WriteOnlyArray {/*...*/} \ No newline at end of file diff --git a/compiler/testData/psi/examples/array/MutableArray.txt b/compiler/testData/psi/examples/array/MutableArray.txt index ff88ce35d04..523be805049 100644 --- a/compiler/testData/psi/examples/array/MutableArray.txt +++ b/compiler/testData/psi/examples/array/MutableArray.txt @@ -42,6 +42,7 @@ JetFile: MutableArray.kt FUN MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -109,6 +110,7 @@ JetFile: MutableArray.kt FUN MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/examples/collections/HashMap.kt b/compiler/testData/psi/examples/collections/HashMap.kt index 3306ad429a0..f8a01c071ea 100644 --- a/compiler/testData/psi/examples/collections/HashMap.kt +++ b/compiler/testData/psi/examples/collections/HashMap.kt @@ -19,7 +19,7 @@ open class IMap { class HashableWrapper(val obj : Any) : IHashable // equals and hashCode implementations are inherited -[inline] fun Any.hashable() : HashableWrapper = HashableWrapper(this) +@[inline] fun Any.hashable() : HashableWrapper = HashableWrapper(this) open class IHashingStrategy { fun equals(a : K, b : K) : Boolean @@ -39,8 +39,8 @@ class JavaObjectHashingStrategy : IHashingStrategy { } class HashMap : IMap { - private [inline] fun hashCode(a : K) = a.hashable().hashCode - private [inline] fun equals(a : K, b : K) = a.hashable() == b + private @[inline] fun hashCode(a : K) = a.hashable().hashCode + private @[inline] fun equals(a : K, b : K) = a.hashable() == b // everything else uses these equals() and hashCode()... diff --git a/compiler/testData/psi/examples/collections/HashMap.txt b/compiler/testData/psi/examples/collections/HashMap.txt index 9401c9c6a25..55fb3159964 100644 --- a/compiler/testData/psi/examples/collections/HashMap.txt +++ b/compiler/testData/psi/examples/collections/HashMap.txt @@ -330,6 +330,7 @@ JetFile: HashMap.kt FUN MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -764,6 +765,7 @@ JetFile: HashMap.kt PsiElement(private)('private') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -811,6 +813,7 @@ JetFile: HashMap.kt PsiElement(private)('private') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/examples/collections/IList.kt b/compiler/testData/psi/examples/collections/IList.kt index 69fff05ca87..a211b818657 100644 --- a/compiler/testData/psi/examples/collections/IList.kt +++ b/compiler/testData/psi/examples/collections/IList.kt @@ -1,4 +1,4 @@ open class IList : IIterable, ISized { - [operator] fun get(index : Int) : T + @[operator] fun get(index : Int) : T val isEmpty : Boolean } \ No newline at end of file diff --git a/compiler/testData/psi/examples/collections/IList.txt b/compiler/testData/psi/examples/collections/IList.txt index bc3ea037c7b..3934abef790 100644 --- a/compiler/testData/psi/examples/collections/IList.txt +++ b/compiler/testData/psi/examples/collections/IList.txt @@ -49,6 +49,7 @@ JetFile: IList.kt FUN MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.kt b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.kt index eb46913f1d1..ebcdce20335 100644 --- a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.kt +++ b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.kt @@ -4,7 +4,7 @@ typealias f = ((T.T.() -> S).() -> S) typealias f = ((T.T.() -> S).() -> S) typealias f = (((S).() -> S).() -> S) -typealias f = [a] ([a] ((S).() -> S).() -> S) -typealias f = [a] ([a] (T.() -> S).() -> S) -typealias f = [a] ([a] (T.() -> S).() -> S) -typealias f = [a] ([a] ((S).() -> S).() -> S) \ No newline at end of file +typealias f = @[a] (@[a] ((S).() -> S).() -> S) +typealias f = @[a] (@[a] (T.() -> S).() -> S) +typealias f = @[a] (@[a] (T.() -> S).() -> S) +typealias f = @[a] (@[a] ((S).() -> S).() -> S) \ No newline at end of file diff --git a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt index 267503bc837..9f9218b2cbe 100644 --- a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt +++ b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt @@ -267,6 +267,7 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -281,6 +282,7 @@ JetFile: FunctionTypesWithFunctionReceivers.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -333,6 +335,7 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -347,6 +350,7 @@ JetFile: FunctionTypesWithFunctionReceivers.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -397,6 +401,7 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -411,6 +416,7 @@ JetFile: FunctionTypesWithFunctionReceivers.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -476,6 +482,7 @@ JetFile: FunctionTypesWithFunctionReceivers.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -490,6 +497,7 @@ JetFile: FunctionTypesWithFunctionReceivers.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.kt b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.kt index 1a2aba704a4..85131e432e8 100644 --- a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.kt +++ b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.kt @@ -1,8 +1,8 @@ -fun ([a] T.(A) -> Unit).foo() -fun ([a] T.(A) -> C).foo(); -fun [a] ([a] T.(A) -> R).foo() {} -fun [a] ((B.(A ->B)) -> Unit).foo() -fun [a] ((A, B) -> Unit).foo() +fun (@[a] T.(A) -> Unit).foo() +fun (@[a] T.(A) -> C).foo(); +fun @[a] (@[a] T.(A) -> R).foo() {} +fun @[a] ((B.(A ->B)) -> Unit).foo() +fun @[a] ((A, B) -> Unit).foo() fun ((T) -> G)?.foo() fun ((T) -> G)??.foo() diff --git a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt index a6f4d854689..db8206f1833 100644 --- a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt +++ b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt @@ -12,6 +12,7 @@ JetFile: FunctionsWithFunctionReceivers.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -72,6 +73,7 @@ JetFile: FunctionsWithFunctionReceivers.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -144,6 +146,7 @@ JetFile: FunctionsWithFunctionReceivers.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -158,6 +161,7 @@ JetFile: FunctionsWithFunctionReceivers.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -228,6 +232,7 @@ JetFile: FunctionsWithFunctionReceivers.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -309,6 +314,7 @@ JetFile: FunctionsWithFunctionReceivers.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversAnnotations.kt b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversAnnotations.kt index 5275ef97d69..9b8f8e33b6f 100644 --- a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversAnnotations.kt +++ b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversAnnotations.kt @@ -1,5 +1,5 @@ -fun ([a] T.(A) -> Unit).foo() -fun ([a] T.(A) -> C).foo(); -fun [a] ([a] T.(A) -> R).foo() {} -fun [a] (() -> Unit).foo() -[a] fun [a] ((A, B) -> Unit).foo() +fun (@[a] T.(A) -> Unit).foo() +fun (@[a] T.(A) -> C).foo(); +fun @[a] (@[a] T.(A) -> R).foo() {} +fun @[a] (() -> Unit).foo() +@[a] fun @[a] ((A, B) -> Unit).foo() diff --git a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversAnnotations.txt b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversAnnotations.txt index 91e94669edd..98ffbb3d068 100644 --- a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversAnnotations.txt +++ b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversAnnotations.txt @@ -12,6 +12,7 @@ JetFile: FunctionsWithFunctionReceiversAnnotations.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -72,6 +73,7 @@ JetFile: FunctionsWithFunctionReceiversAnnotations.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -144,6 +146,7 @@ JetFile: FunctionsWithFunctionReceiversAnnotations.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -158,6 +161,7 @@ JetFile: FunctionsWithFunctionReceiversAnnotations.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -228,6 +232,7 @@ JetFile: FunctionsWithFunctionReceiversAnnotations.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -259,6 +264,7 @@ JetFile: FunctionsWithFunctionReceiversAnnotations.kt FUN MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -282,6 +288,7 @@ JetFile: FunctionsWithFunctionReceiversAnnotations.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversRecovery.kt b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversRecovery.kt index 47c78e78ece..2351caad754 100644 --- a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversRecovery.kt +++ b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversRecovery.kt @@ -5,11 +5,11 @@ fun ((T) -> G).foo = 0 fun ((T) -> G)?.foo { } fun ((T) -> G)??.foo { } -fun ([a] T.(A, C) -> ).foo() {} -fun fun [a] T.(A).foo() +fun (@[a] T.(A, C) -> ).foo() {} +fun fun @[a] T.(A).foo() -fun [a] (T.(A)).foo() -fun [a] ((A)-).foo() +fun @[a] (T.(A)).foo() +fun @[a] ((A)-).foo() fun ((T)->G).foo class C. diff --git a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversRecovery.txt b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversRecovery.txt index c7acc92c2d2..b4337676616 100644 --- a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversRecovery.txt +++ b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceiversRecovery.txt @@ -215,6 +215,7 @@ JetFile: FunctionsWithFunctionReceiversRecovery.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -301,6 +302,7 @@ JetFile: FunctionsWithFunctionReceiversRecovery.kt PsiWhiteSpace(' ') MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -363,6 +365,7 @@ JetFile: FunctionsWithFunctionReceiversRecovery.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -427,9 +430,11 @@ JetFile: FunctionsWithFunctionReceiversRecovery.kt PsiElement(fun)('fun') PsiWhiteSpace(' ') PsiErrorElement:Expecting function name - PsiElement(LBRACKET)('[') + PsiElement(AT)('@') PsiErrorElement:Expecting '(' + PsiErrorElement:Expecting a top level declaration + PsiElement(LBRACKET)('[') MODIFIER_LIST ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.kt b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.kt index ecdd563a581..7094dd63605 100644 --- a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.kt +++ b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.kt @@ -11,7 +11,7 @@ val (foo.bar.() -> Unit).foo = foo val (foo.bar.() -> Unit).foo : bar = foo - [a] public get() {} + @[a] public get() {} open set(a : b) {} @@ -20,7 +20,7 @@ val (foo.bar.() -> Unit).foo : bar = foo val (foo.bar.() -> Unit).foo : bar = foo - [a] public get() {} + @[a] public get() {} // Error recovery: diff --git a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt index c81db8807b6..88cad35c81a 100644 --- a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt +++ b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt @@ -222,6 +222,7 @@ JetFile: PropertiesWithFunctionReceivers.kt PROPERTY_ACCESSOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -372,6 +373,7 @@ JetFile: PropertiesWithFunctionReceivers.kt PROPERTY_ACCESSOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversAnnotations.kt b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversAnnotations.kt index ab23ad3988b..cefe1308e1e 100644 --- a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversAnnotations.kt +++ b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversAnnotations.kt @@ -1,5 +1,5 @@ -val ([a] T.(A) -> Unit).foo: P -val ([a] T.(A) -> C).foo: P -val [a] ([a] T.(A) -> R).foo: P -val [a] (() -> Unit).foo: P -[a] val [a] ((A, B) -> Unit).foo: P +val (@[a] T.(A) -> Unit).foo: P +val (@[a] T.(A) -> C).foo: P +val @[a] (@[a] T.(A) -> R).foo: P +val @[a] (() -> Unit).foo: P +@[a] val @[a] ((A, B) -> Unit).foo: P diff --git a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversAnnotations.txt b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversAnnotations.txt index fd1ed74d340..d34eaae99ca 100644 --- a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversAnnotations.txt +++ b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversAnnotations.txt @@ -12,6 +12,7 @@ JetFile: PropertiesWithFunctionReceiversAnnotations.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -75,6 +76,7 @@ JetFile: PropertiesWithFunctionReceiversAnnotations.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -149,6 +151,7 @@ JetFile: PropertiesWithFunctionReceiversAnnotations.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -163,6 +166,7 @@ JetFile: PropertiesWithFunctionReceiversAnnotations.kt FUNCTION_TYPE_RECEIVER TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -232,6 +236,7 @@ JetFile: PropertiesWithFunctionReceiversAnnotations.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -266,6 +271,7 @@ JetFile: PropertiesWithFunctionReceiversAnnotations.kt PROPERTY MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -289,6 +295,7 @@ JetFile: PropertiesWithFunctionReceiversAnnotations.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.kt b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.kt index bfecfff0ca9..89a99eff7bb 100644 --- a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.kt +++ b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.kt @@ -6,9 +6,9 @@ val ((T) -> G)?.foo val ((T) -> G)??.foo val (T.(A, C) -> ).foo {} -val val [a] T.(A).foo() +val val @a T.(A).foo() -val [a] (T.(A)).foo() -val [a] ((A)-).foo() +val @[a] (T.(A)).foo() +val @[a] ((A)-).foo() val c by A.B \ No newline at end of file diff --git a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.txt b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.txt index 3bd7bdeda3e..61cba93011e 100644 --- a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.txt +++ b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.txt @@ -282,9 +282,8 @@ JetFile: PropertiesWithFunctionReceiversRecovery.kt PsiErrorElement:Property getter or setter expected PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(LBRACKET)('[') + PsiElement(AT)('@') PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('T') PsiElement(LT)('<') @@ -307,6 +306,7 @@ JetFile: PropertiesWithFunctionReceiversRecovery.kt PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -375,6 +375,7 @@ JetFile: PropertiesWithFunctionReceiversRecovery.kt PsiErrorElement:Receiver type is not allowed on a multi-declaration TYPE_REFERENCE ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/packages/PackageModifiers.kt b/compiler/testData/psi/packages/PackageModifiers.kt index ebb056dda85..fe991547c78 100644 --- a/compiler/testData/psi/packages/PackageModifiers.kt +++ b/compiler/testData/psi/packages/PackageModifiers.kt @@ -1 +1 @@ -public [a] package name \ No newline at end of file +public @[a] package name \ No newline at end of file diff --git a/compiler/testData/psi/packages/PackageModifiers.txt b/compiler/testData/psi/packages/PackageModifiers.txt index cc55ac8209d..918abb8d7c9 100644 --- a/compiler/testData/psi/packages/PackageModifiers.txt +++ b/compiler/testData/psi/packages/PackageModifiers.txt @@ -4,6 +4,7 @@ JetFile: PackageModifiers.kt PsiElement(public)('public') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -18,4 +19,4 @@ JetFile: PackageModifiers.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('name') IMPORT_LIST - \ No newline at end of file + diff --git a/compiler/testData/psi/recovery/EnumEntryInitList.kt b/compiler/testData/psi/recovery/EnumEntryInitList.kt index 9a135713535..40ceef12b83 100644 --- a/compiler/testData/psi/recovery/EnumEntryInitList.kt +++ b/compiler/testData/psi/recovery/EnumEntryInitList.kt @@ -35,7 +35,7 @@ enum class E6 { enum class E7 { FIRST: - [Some] + @[Some] SECOND } diff --git a/compiler/testData/psi/recovery/EnumEntryInitList.txt b/compiler/testData/psi/recovery/EnumEntryInitList.txt index a7a37023e22..2ec047794a6 100644 --- a/compiler/testData/psi/recovery/EnumEntryInitList.txt +++ b/compiler/testData/psi/recovery/EnumEntryInitList.txt @@ -204,6 +204,7 @@ JetFile: EnumEntryInitList.kt INITIALIZER_LIST DELEGATOR_SUPER_CALL ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.kt b/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.kt index 68a749403e0..6217446f6c2 100644 --- a/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.kt +++ b/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.kt @@ -6,4 +6,4 @@ object Foo private () : Bar { } -object Foo [foo] private [bar()] () \ No newline at end of file +object Foo @[foo] private @[bar()] () \ 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 39252d15a38..6b8500aa694 100644 --- a/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt +++ b/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt @@ -72,6 +72,7 @@ JetFile: ConstructorModifiers.kt PRIMARY_CONSTRUCTOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -84,6 +85,7 @@ JetFile: ConstructorModifiers.kt PsiElement(private)('private') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.kt b/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.kt index 930721fb7a2..ef5eda15a3a 100644 --- a/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.kt +++ b/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.kt @@ -4,4 +4,4 @@ public class Bar object Foo -[foo] class Bar \ No newline at end of file +@[foo] class Bar \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.txt b/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.txt index 3628051e902..d53dbcaec1a 100644 --- a/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.txt +++ b/compiler/testData/psi/recovery/objects/declarations/FollowedByModifiers.txt @@ -26,6 +26,7 @@ JetFile: FollowedByModifiers.kt CLASS MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.kt b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.kt index 4efe42fdf72..ff4cd0baa80 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.kt +++ b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.kt @@ -4,6 +4,6 @@ val foo = object private () : Bar { } -val foo = object [foo] private [bar()] () {} +val foo = object @[foo] private @[bar()] () {} val foo = object private () diff --git a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt index 403fb7634c9..e7a876a36d9 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt +++ b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt @@ -73,6 +73,7 @@ JetFile: ConstructorModifiers.kt PRIMARY_CONSTRUCTOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -85,6 +86,7 @@ JetFile: ConstructorModifiers.kt PsiElement(private)('private') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.kt b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.kt index 7242c49ddbf..265e3ecec84 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.kt +++ b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.kt @@ -5,6 +5,6 @@ val foo = object Name private () : Bar { } -val foo = object Name [foo] private [bar()] () {} +val foo = object Name @[foo] private @[bar()] () {} val foo = object Name private () diff --git a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt index 617358a8a4f..e3ab00863a3 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt +++ b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt @@ -82,6 +82,7 @@ JetFile: ConstructorModifiersAndName.kt PRIMARY_CONSTRUCTOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -94,6 +95,7 @@ JetFile: ConstructorModifiersAndName.kt PsiElement(private)('private') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/recovery/objects/expressions/InFunction.kt b/compiler/testData/psi/recovery/objects/expressions/InFunction.kt index 4c725072fcd..7bc87b0c018 100644 --- a/compiler/testData/psi/recovery/objects/expressions/InFunction.kt +++ b/compiler/testData/psi/recovery/objects/expressions/InFunction.kt @@ -3,7 +3,7 @@ fun foo() { val foo = object private () : Bar - val foo = object [foo] private [bar()] () + val foo = object @[foo] private @[bar()] () val foo = object private () } \ No newline at end of file diff --git a/compiler/testData/psi/recovery/objects/expressions/InFunction.txt b/compiler/testData/psi/recovery/objects/expressions/InFunction.txt index 59b9f51c284..e940015fca1 100644 --- a/compiler/testData/psi/recovery/objects/expressions/InFunction.txt +++ b/compiler/testData/psi/recovery/objects/expressions/InFunction.txt @@ -81,6 +81,7 @@ JetFile: InFunction.kt PRIMARY_CONSTRUCTOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -93,6 +94,7 @@ JetFile: InFunction.kt PsiElement(private)('private') PsiWhiteSpace(' ') ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/script/manyAnnotationsOnFile.kts b/compiler/testData/psi/script/manyAnnotationsOnFile.kts index bfb1ddc8b8d..62feb7a88aa 100644 --- a/compiler/testData/psi/script/manyAnnotationsOnFile.kts +++ b/compiler/testData/psi/script/manyAnnotationsOnFile.kts @@ -1,3 +1,3 @@ -[file: foo] -[file:bar baz] +@file:[ foo] +@file:[bar baz] package bar diff --git a/compiler/testData/psi/script/manyAnnotationsOnFile.txt b/compiler/testData/psi/script/manyAnnotationsOnFile.txt index 93a96576936..9ce81939a0f 100644 --- a/compiler/testData/psi/script/manyAnnotationsOnFile.txt +++ b/compiler/testData/psi/script/manyAnnotationsOnFile.txt @@ -1,9 +1,10 @@ JetFile: manyAnnotationsOnFile.kts FILE_ANNOTATION_LIST ANNOTATION - PsiElement(LBRACKET)('[') + PsiElement(AT)('@') PsiElement(file)('file') PsiElement(COLON)(':') + PsiElement(LBRACKET)('[') PsiWhiteSpace(' ') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE @@ -14,9 +15,10 @@ JetFile: manyAnnotationsOnFile.kts PsiElement(RBRACKET)(']') PsiWhiteSpace('\n') ANNOTATION - PsiElement(LBRACKET)('[') + PsiElement(AT)('@') PsiElement(file)('file') PsiElement(COLON)(':') + PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE @@ -41,4 +43,4 @@ JetFile: manyAnnotationsOnFile.kts SCRIPT BLOCK - \ No newline at end of file + diff --git a/compiler/testData/psi/secondaryConstructors/basic.kt b/compiler/testData/psi/secondaryConstructors/basic.kt index fa07a358a88..b2cf9294124 100644 --- a/compiler/testData/psi/secondaryConstructors/basic.kt +++ b/compiler/testData/psi/secondaryConstructors/basic.kt @@ -5,11 +5,11 @@ class A { private annot constructor(x: Int) {} - [constructor] fun constructor() {} + @constructor fun constructor() {} annot protected constructor(x: Int, y: Int) : this(1,2) {} - [constructor] public constructor() : super() { + @[constructor] public constructor() : super() { x = 1 } } diff --git a/compiler/testData/psi/secondaryConstructors/basic.txt b/compiler/testData/psi/secondaryConstructors/basic.txt index 728ace1b86e..4f6117afc35 100644 --- a/compiler/testData/psi/secondaryConstructors/basic.txt +++ b/compiler/testData/psi/secondaryConstructors/basic.txt @@ -68,15 +68,13 @@ JetFile: basic.kt PsiWhiteSpace('\n\n ') FUN MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('constructor') - PsiElement(RBRACKET)(']') + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('constructor') PsiWhiteSpace(' ') PsiElement(fun)('fun') PsiWhiteSpace(' ') @@ -146,6 +144,7 @@ JetFile: basic.kt SECONDARY_CONSTRUCTOR MODIFIER_LIST ANNOTATION + PsiElement(AT)('@') PsiElement(LBRACKET)('[') ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java index 08cebb73c44..b39205bcfa4 100644 --- a/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/parsing/JetParsingTestGenerated.java @@ -735,6 +735,12 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } + @TestMetadata("oldAnnotationsRecovery.kt") + public void testOldAnnotationsRecovery() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/oldAnnotationsRecovery.kt"); + doParsingTest(fileName); + } + @TestMetadata("ShortAnnotations.kt") public void testShortAnnotations() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/ShortAnnotations.kt"); @@ -887,63 +893,6 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest { doParsingTest(fileName); } } - - @TestMetadata("compiler/testData/psi/annotation/onFileObsolete") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class OnFileObsolete extends AbstractJetParsingTest { - public void testAllFilesPresentInOnFileObsolete() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/psi/annotation/onFileObsolete"), Pattern.compile("^(.*)\\.kts?$"), true); - } - - @TestMetadata("fileAnnotationInWrongPlace.kt") - public void testFileAnnotationInWrongPlace() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/onFileObsolete/fileAnnotationInWrongPlace.kt"); - doParsingTest(fileName); - } - - @TestMetadata("manyAnnotationBlocks.kt") - public void testManyAnnotationBlocks() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/onFileObsolete/manyAnnotationBlocks.kt"); - doParsingTest(fileName); - } - - @TestMetadata("manyInOneAnnotationBlock.kt") - public void testManyInOneAnnotationBlock() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/onFileObsolete/manyInOneAnnotationBlock.kt"); - doParsingTest(fileName); - } - - @TestMetadata("nonFIleAnnotationBeforePackage.kt") - public void testNonFIleAnnotationBeforePackage() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/onFileObsolete/nonFIleAnnotationBeforePackage.kt"); - doParsingTest(fileName); - } - - @TestMetadata("single.kt") - public void testSingle() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/onFileObsolete/single.kt"); - doParsingTest(fileName); - } - - @TestMetadata("withoutFileAnnotationAndPackageDeclaration.kt") - public void testWithoutFileAnnotationAndPackageDeclaration() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/onFileObsolete/withoutFileAnnotationAndPackageDeclaration.kt"); - doParsingTest(fileName); - } - - @TestMetadata("withoutPackage.kt") - public void testWithoutPackage() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/onFileObsolete/withoutPackage.kt"); - doParsingTest(fileName); - } - - @TestMetadata("withoutPackageWithSimpleAnnotation.kt") - public void testWithoutPackageWithSimpleAnnotation() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/annotation/onFileObsolete/withoutPackageWithSimpleAnnotation.kt"); - doParsingTest(fileName); - } - } } @TestMetadata("compiler/testData/psi/examples")