delegate use-site targeted annotations: parser, front-end, codegen with some tests #KT-10502 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-01-14 16:28:29 +03:00
parent 474076a550
commit b78d481bb1
29 changed files with 366 additions and 51 deletions
@@ -0,0 +1,7 @@
class C {
@delegate:Transient
val plainField: Int = 1
@delegate:Transient
val lazy by lazy { 1 }
}
@@ -0,0 +1,77 @@
JetFile: delegate.kt
PACKAGE_DIRECTIVE
<empty list>
IMPORT_LIST
<empty list>
CLASS
PsiElement(class)('class')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('C')
PsiWhiteSpace(' ')
CLASS_BODY
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
PROPERTY
MODIFIER_LIST
ANNOTATION_ENTRY
PsiElement(AT)('@')
ANNOTATION_TARGET
PsiElement(delegate)('delegate')
PsiElement(COLON)(':')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Transient')
PsiWhiteSpace('\n ')
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('plainField')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
PsiWhiteSpace(' ')
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n\n ')
PROPERTY
MODIFIER_LIST
ANNOTATION_ENTRY
PsiElement(AT)('@')
ANNOTATION_TARGET
PsiElement(delegate)('delegate')
PsiElement(COLON)(':')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Transient')
PsiWhiteSpace('\n ')
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('lazy')
PsiWhiteSpace(' ')
PROPERTY_DELEGATE
PsiElement(by)('by')
PsiWhiteSpace(' ')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('lazy')
PsiWhiteSpace(' ')
LAMBDA_ARGUMENT
LAMBDA_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace(' ')
BLOCK
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')