diff --git a/compiler/frontend/src/org/jetbrains/kotlin/lexer/JetTokens.java b/compiler/frontend/src/org/jetbrains/kotlin/lexer/JetTokens.java index c6326eac480..69ce13f5ae9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/lexer/JetTokens.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/lexer/JetTokens.java @@ -137,7 +137,7 @@ public interface JetTokens { JetKeywordToken PROPERTY_KEYWORD = JetKeywordToken.softKeyword("property"); JetKeywordToken RECEIVER_KEYWORD = JetKeywordToken.softKeyword("receiver"); JetKeywordToken PARAM_KEYWORD = JetKeywordToken.softKeyword("param"); - JetKeywordToken SPARAM_KEYWORD = JetKeywordToken.softKeyword("sparam"); + JetKeywordToken SETPARAM_KEYWORD = JetKeywordToken.softKeyword("setparam"); JetKeywordToken IMPORT_KEYWORD = JetKeywordToken.softKeyword("import"); JetKeywordToken WHERE_KEYWORD = JetKeywordToken.softKeyword("where"); JetKeywordToken BY_KEYWORD = JetKeywordToken.softKeyword("by"); @@ -196,7 +196,7 @@ public interface JetTokens { OVERRIDE_KEYWORD, PRIVATE_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD, PROTECTED_KEYWORD, CATCH_KEYWORD, FINALLY_KEYWORD, OUT_KEYWORD, FINAL_KEYWORD, VARARG_KEYWORD, REIFIED_KEYWORD, DYNAMIC_KEYWORD, COMPANION_KEYWORD, CONSTRUCTOR_KEYWORD, INIT_KEYWORD, SEALED_KEYWORD, - FIELD_KEYWORD, PROPERTY_KEYWORD, RECEIVER_KEYWORD, PARAM_KEYWORD, SPARAM_KEYWORD, + FIELD_KEYWORD, PROPERTY_KEYWORD, RECEIVER_KEYWORD, PARAM_KEYWORD, SETPARAM_KEYWORD, LATE_INIT_KEYWORD, DATA_KEYWORD, INLINE_KEYWORD, NOINLINE_KEYWORD, TAILREC_KEYWORD, EXTERNAL_KEYWORD, ANNOTATION_KEYWORD, CROSSINLINE_KEYWORD, CONST_KEYWORD, OPERATOR_KEYWORD, INFIX_KEYWORD diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java index fb104b1b112..1303636dc02 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java @@ -65,7 +65,7 @@ public class JetParsing extends AbstractJetParsing { TokenSet.orSet(TokenSet.create(IDENTIFIER, LBRACKET), MODIFIER_KEYWORDS); private static final TokenSet SOFT_KEYWORDS_AT_MEMBER_START = TokenSet.create(CONSTRUCTOR_KEYWORD, INIT_KEYWORD); private static final TokenSet ANNOTATION_TARGETS = TokenSet.create( - FILE_KEYWORD, FIELD_KEYWORD, GET_KEYWORD, SET_KEYWORD, PROPERTY_KEYWORD, RECEIVER_KEYWORD, PARAM_KEYWORD, SPARAM_KEYWORD); + FILE_KEYWORD, FIELD_KEYWORD, GET_KEYWORD, SET_KEYWORD, PROPERTY_KEYWORD, RECEIVER_KEYWORD, PARAM_KEYWORD, SETPARAM_KEYWORD); static JetParsing createForTopLevel(SemanticWhitespaceAwarePsiBuilder builder) { JetParsing jetParsing = new JetParsing(builder); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetAnnotationUseSiteTarget.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetAnnotationUseSiteTarget.kt index 3ee0d7ce1a3..7ed1703e3cd 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetAnnotationUseSiteTarget.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetAnnotationUseSiteTarget.kt @@ -53,7 +53,7 @@ public class JetAnnotationUseSiteTarget : JetElementImplStub AnnotationUseSiteTarget.PROPERTY_SETTER JetTokens.RECEIVER_KEYWORD -> AnnotationUseSiteTarget.RECEIVER JetTokens.PARAM_KEYWORD -> AnnotationUseSiteTarget.CONSTRUCTOR_PARAMETER - JetTokens.SPARAM_KEYWORD -> AnnotationUseSiteTarget.SETTER_PARAMETER + JetTokens.SETPARAM_KEYWORD -> AnnotationUseSiteTarget.SETTER_PARAMETER else -> throw IllegalStateException("Unknown annotation target " + node.getText()) } } diff --git a/compiler/testData/codegen/bytecodeListing/annotations/onProperties.kt b/compiler/testData/codegen/bytecodeListing/annotations/onProperties.kt index 1486bf2c799..8e76475e603 100644 --- a/compiler/testData/codegen/bytecodeListing/annotations/onProperties.kt +++ b/compiler/testData/codegen/bytecodeListing/annotations/onProperties.kt @@ -7,7 +7,7 @@ annotation class AnnParam public class A(@AnnParam @field:AnnField @property:AnnProp2 val x: Int, @param:AnnParam @get:AnnGetter @set:AnnSetter var y: Int) { - @AnnProp @field:AnnField @property:AnnProp2 @get:AnnGetter @set:AnnSetter @sparam:AnnParam + @AnnProp @field:AnnField @property:AnnProp2 @get:AnnGetter @set:AnnSetter @setparam:AnnParam var p: Int = 0 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt index c2779afd51a..f05884c458e 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt @@ -5,32 +5,32 @@ class CustomDelegate { fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} } -@sparam:Ann +@setparam:Ann class SomeClass { - @sparam:Ann + @setparam:Ann constructor() - @sparam:Ann + @setparam:Ann protected val simpleProperty: String = "text" - @sparam:Ann + @setparam:Ann protected var mutableProperty: String = "text" - @sparam:[Ann] + @setparam:[Ann] protected var mutablePropertyWithAnnotationList: String = "text" - @sparam:Ann + @setparam:Ann protected var delegatedProperty: String by CustomDelegate() - @sparam:Ann + @setparam:Ann var propertyWithCustomSetter: Int get() = 5 set(v) {} - @sparam:Ann + @setparam:Ann fun anotherFun() { - @sparam:Ann + @setparam:Ann val localVariable = 5 } diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.txt index 91b54ef1923..ace6401319a 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.txt @@ -16,14 +16,14 @@ public final class CustomDelegate { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -@sparam:Ann() public final class SomeClass { - @sparam:Ann() public constructor SomeClass() - @sparam:Ann() protected final var delegatedProperty: kotlin.String - @sparam:Ann() protected final var mutableProperty: kotlin.String - @sparam:Ann() protected final var mutablePropertyWithAnnotationList: kotlin.String - @sparam:Ann() public final var propertyWithCustomSetter: kotlin.Int - @sparam:Ann() protected final val simpleProperty: kotlin.String = "text" - @sparam:Ann() public final fun anotherFun(): kotlin.Unit +@setparam:Ann() public final class SomeClass { + @setparam:Ann() public constructor SomeClass() + @setparam:Ann() protected final var delegatedProperty: kotlin.String + @setparam:Ann() protected final var mutableProperty: kotlin.String + @setparam:Ann() protected final var mutablePropertyWithAnnotationList: kotlin.String + @setparam:Ann() public final var propertyWithCustomSetter: kotlin.Int + @setparam:Ann() protected final val simpleProperty: kotlin.String = "text" + @setparam:Ann() public final fun anotherFun(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/psi/SoftKeywords.kt b/compiler/testData/psi/SoftKeywords.kt index 0fe62fb028d..b397be497c2 100644 --- a/compiler/testData/psi/SoftKeywords.kt +++ b/compiler/testData/psi/SoftKeywords.kt @@ -58,7 +58,7 @@ ref val property val receiver val param - val sparam + val setparam val lateinit val const get() = a @@ -93,7 +93,7 @@ ref fun property () : property fun receiver () : receiver fun param () : param - fun sparam () : sparam + fun setparam () : setparam fun lateinit () : lateinit fun const () : const @@ -125,7 +125,7 @@ ref property : t, receiver : t, param : t, - sparam : t, + setparam : t, lateinit : t, const : t, public protected private internal abstract @@ -174,7 +174,7 @@ class F(val foo : bar, property : t, receiver : t, param : t, - sparam : t, + setparam : t, lateinit : t, const : t, public protected private internal abstract diff --git a/compiler/testData/psi/SoftKeywords.txt b/compiler/testData/psi/SoftKeywords.txt index 852bdbd2e64..4bd243e95d2 100644 --- a/compiler/testData/psi/SoftKeywords.txt +++ b/compiler/testData/psi/SoftKeywords.txt @@ -311,7 +311,7 @@ JetFile: SoftKeywords.kt PROPERTY PsiElement(val)('val') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('sparam') + PsiElement(IDENTIFIER)('setparam') PsiWhiteSpace('\n ') PROPERTY PsiElement(val)('val') @@ -796,7 +796,7 @@ JetFile: SoftKeywords.kt FUN PsiElement(fun)('fun') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('sparam') + PsiElement(IDENTIFIER)('setparam') PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') @@ -807,7 +807,7 @@ JetFile: SoftKeywords.kt TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('sparam') + PsiElement(IDENTIFIER)('setparam') PsiWhiteSpace('\n ') FUN PsiElement(fun)('fun') @@ -1146,7 +1146,7 @@ JetFile: SoftKeywords.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') VALUE_PARAMETER - PsiElement(IDENTIFIER)('sparam') + PsiElement(IDENTIFIER)('setparam') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -1543,7 +1543,7 @@ JetFile: SoftKeywords.kt PsiElement(COMMA)(',') PsiWhiteSpace('\n ') VALUE_PARAMETER - PsiElement(IDENTIFIER)('sparam') + PsiElement(IDENTIFIER)('setparam') PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/annotation/targeted/onGetSetSparam/inWrongPlace.kt b/compiler/testData/psi/annotation/targeted/onGetSetSparam/inWrongPlace.kt index 842190c22d5..29f9c99d9a2 100644 --- a/compiler/testData/psi/annotation/targeted/onGetSetSparam/inWrongPlace.kt +++ b/compiler/testData/psi/annotation/targeted/onGetSetSparam/inWrongPlace.kt @@ -1,28 +1,28 @@ @get:Deprecated @set:Deprecated -@sparam:Deprecated +@setparam:Deprecated @get:Deprecated @set:Deprecated -@sparam:Deprecated +@setparam:Deprecated package boo @get:Deprecated @set:Deprecated -@sparam:Deprecated +@setparam:Deprecated class A @get:Deprecated @set:Deprecated -@sparam:Deprecated +@setparam:Deprecated interface I @get:Deprecated @set:Deprecated -@sparam:Deprecated +@setparam:Deprecated fun a() @get:Deprecated @set:Deprecated -@sparam:Deprecated +@setparam:Deprecated fun b() \ No newline at end of file diff --git a/compiler/testData/psi/annotation/targeted/onGetSetSparam/inWrongPlace.txt b/compiler/testData/psi/annotation/targeted/onGetSetSparam/inWrongPlace.txt index 2425596f4de..bf44de23a7c 100644 --- a/compiler/testData/psi/annotation/targeted/onGetSetSparam/inWrongPlace.txt +++ b/compiler/testData/psi/annotation/targeted/onGetSetSparam/inWrongPlace.txt @@ -25,7 +25,7 @@ JetFile: inWrongPlace.kt ANNOTATION_ENTRY PsiElement(AT)('@') ANNOTATION_TARGET - PsiElement(sparam)('sparam') + PsiElement(setparam)('setparam') PsiElement(COLON)(':') CONSTRUCTOR_CALLEE TYPE_REFERENCE @@ -58,7 +58,7 @@ JetFile: inWrongPlace.kt ANNOTATION_ENTRY PsiElement(AT)('@') ANNOTATION_TARGET - PsiElement(sparam)('sparam') + PsiElement(setparam)('setparam') PsiElement(COLON)(':') CONSTRUCTOR_CALLEE TYPE_REFERENCE @@ -101,7 +101,7 @@ JetFile: inWrongPlace.kt ANNOTATION_ENTRY PsiElement(AT)('@') ANNOTATION_TARGET - PsiElement(sparam)('sparam') + PsiElement(setparam)('setparam') PsiElement(COLON)(':') CONSTRUCTOR_CALLEE TYPE_REFERENCE @@ -140,7 +140,7 @@ JetFile: inWrongPlace.kt ANNOTATION_ENTRY PsiElement(AT)('@') ANNOTATION_TARGET - PsiElement(sparam)('sparam') + PsiElement(setparam)('setparam') PsiElement(COLON)(':') CONSTRUCTOR_CALLEE TYPE_REFERENCE @@ -179,7 +179,7 @@ JetFile: inWrongPlace.kt ANNOTATION_ENTRY PsiElement(AT)('@') ANNOTATION_TARGET - PsiElement(sparam)('sparam') + PsiElement(setparam)('setparam') PsiElement(COLON)(':') CONSTRUCTOR_CALLEE TYPE_REFERENCE @@ -221,7 +221,7 @@ JetFile: inWrongPlace.kt ANNOTATION_ENTRY PsiElement(AT)('@') ANNOTATION_TARGET - PsiElement(sparam)('sparam') + PsiElement(setparam)('setparam') PsiElement(COLON)(':') CONSTRUCTOR_CALLEE TYPE_REFERENCE diff --git a/compiler/testData/psi/annotation/targeted/onGetSetSparam/simple.kt b/compiler/testData/psi/annotation/targeted/onGetSetSparam/simple.kt index e34a7ed3f9e..94bf798cb2e 100644 --- a/compiler/testData/psi/annotation/targeted/onGetSetSparam/simple.kt +++ b/compiler/testData/psi/annotation/targeted/onGetSetSparam/simple.kt @@ -2,7 +2,7 @@ class A { @get:An @set:An - @sparam:An + @setparam:An var a: String = "A" } \ No newline at end of file diff --git a/compiler/testData/psi/annotation/targeted/onGetSetSparam/simple.txt b/compiler/testData/psi/annotation/targeted/onGetSetSparam/simple.txt index c61ba8bf429..8ce379df85e 100644 --- a/compiler/testData/psi/annotation/targeted/onGetSetSparam/simple.txt +++ b/compiler/testData/psi/annotation/targeted/onGetSetSparam/simple.txt @@ -38,7 +38,7 @@ JetFile: simple.kt ANNOTATION_ENTRY PsiElement(AT)('@') ANNOTATION_TARGET - PsiElement(sparam)('sparam') + PsiElement(setparam)('setparam') PsiElement(COLON)(':') CONSTRUCTOR_CALLEE TYPE_REFERENCE diff --git a/compiler/testData/psi/annotation/targeted/onGetSetSparam/twoAnnotationLists.kt b/compiler/testData/psi/annotation/targeted/onGetSetSparam/twoAnnotationLists.kt index 9e6548d61a0..9f0e611c0c3 100644 --- a/compiler/testData/psi/annotation/targeted/onGetSetSparam/twoAnnotationLists.kt +++ b/compiler/testData/psi/annotation/targeted/onGetSetSparam/twoAnnotationLists.kt @@ -2,7 +2,7 @@ class A { @get:a @set:[b c] - @sparam:d + @setparam:d var a: Int @e get() = 5 @f @g set(@h v) {} diff --git a/compiler/testData/psi/annotation/targeted/onGetSetSparam/twoAnnotationLists.txt b/compiler/testData/psi/annotation/targeted/onGetSetSparam/twoAnnotationLists.txt index 4c0cb988737..210ac863054 100644 --- a/compiler/testData/psi/annotation/targeted/onGetSetSparam/twoAnnotationLists.txt +++ b/compiler/testData/psi/annotation/targeted/onGetSetSparam/twoAnnotationLists.txt @@ -48,7 +48,7 @@ JetFile: twoAnnotationLists.kt ANNOTATION_ENTRY PsiElement(AT)('@') ANNOTATION_TARGET - PsiElement(sparam)('sparam') + PsiElement(setparam)('setparam') PsiElement(COLON)(':') CONSTRUCTOR_CALLEE TYPE_REFERENCE diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationUseSiteTarget.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationUseSiteTarget.kt index 6fc0e66db8d..9bdfd6e7779 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationUseSiteTarget.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationUseSiteTarget.kt @@ -26,7 +26,7 @@ public enum class AnnotationUseSiteTarget(renderName: String? = null) { PROPERTY_SETTER("set"), RECEIVER(), CONSTRUCTOR_PARAMETER("param"), - SETTER_PARAMETER("sparam"); + SETTER_PARAMETER("setparam"); public val renderName: String = renderName ?: name().toLowerCase()