Support @field: annotations

This commit is contained in:
Yan Zhulanow
2015-07-16 16:38:08 +03:00
parent 0499335c34
commit 2bacbc9046
34 changed files with 431 additions and 67 deletions
+2 -1
View File
@@ -2,7 +2,8 @@ JetFile: DocCommentAfterFileAnnotations.kt
FILE_ANNOTATION_LIST
ANNOTATION
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiElement(LBRACKET)('[')
ANNOTATION_ENTRY
+3 -2
View File
@@ -2,7 +2,8 @@ JetFile: LineCommentAfterFileAnnotations.kt
FILE_ANNOTATION_LIST
ANNOTATION
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiElement(LBRACKET)('[')
ANNOTATION_ENTRY
@@ -25,4 +26,4 @@ JetFile: LineCommentAfterFileAnnotations.kt
PsiElement(IDENTIFIER)('C')
CLASS_BODY
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
PsiElement(RBRACE)('}')
@@ -11,7 +11,7 @@ JetFile: fileAnnotationInWrongPlace.kt
MODIFIER_LIST
ANNOTATION_ENTRY
PsiElement(AT)('@')
PsiErrorElement:File annotations are only allowed before package declaration
PsiErrorElement:@file annotations are only allowed before package declaration
PsiElement(file)('file')
PsiElement(COLON)(':')
CONSTRUCTOR_CALLEE
@@ -28,7 +28,7 @@ JetFile: fileAnnotationInWrongPlace.kt
MODIFIER_LIST
ANNOTATION
PsiElement(AT)('@')
PsiErrorElement:File annotations are only allowed before package declaration
PsiErrorElement:@file annotations are only allowed before package declaration
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiElement(LBRACKET)('[')
@@ -62,7 +62,7 @@ JetFile: fileAnnotationInWrongPlace.kt
MODIFIER_LIST
ANNOTATION
PsiElement(AT)('@')
PsiErrorElement:File annotations are only allowed before package declaration
PsiErrorElement:@file annotations are only allowed before package declaration
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiElement(LBRACKET)('[')
@@ -80,7 +80,7 @@ JetFile: fileAnnotationInWrongPlace.kt
PsiWhiteSpace('\n\n')
CLASS
MODIFIER_LIST
PsiErrorElement:Expected annotation identifier after '@file:'
PsiErrorElement:Expected annotation identifier after ':'
PsiElement(AT)('@')
PsiElement(IDENTIFIER)('file')
PsiElement(COLON)(':')
@@ -93,7 +93,7 @@ JetFile: fileAnnotationInWrongPlace.kt
MODIFIER_LIST
ANNOTATION
PsiElement(AT)('@')
PsiErrorElement:File annotations are only allowed before package declaration
PsiErrorElement:@file annotations are only allowed before package declaration
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiElement(LBRACKET)('[')
@@ -103,4 +103,4 @@ JetFile: fileAnnotationInWrongPlace.kt
PsiWhiteSpace('\n')
PsiElement(trait)('trait')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiElement(IDENTIFIER)('T')
@@ -2,7 +2,8 @@ JetFile: manyAnnotationBlocks.kt
FILE_ANNOTATION_LIST
ANNOTATION_ENTRY
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
@@ -12,7 +13,8 @@ JetFile: manyAnnotationBlocks.kt
PsiWhiteSpace('\n')
ANNOTATION
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiElement(LBRACKET)('[')
ANNOTATION_ENTRY
@@ -2,7 +2,8 @@ JetFile: manyInOneAnnotationBlock.kt
FILE_ANNOTATION_LIST
ANNOTATION
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(LBRACKET)('[')
@@ -12,7 +12,8 @@ JetFile: nonFIleAnnotationBeforePackage.kt
PsiWhiteSpace('\n')
ANNOTATION_ENTRY
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting "file:" prefix for file annotations
PsiElement(AT)('@')
@@ -22,14 +23,14 @@ JetFile: nonFIleAnnotationBeforePackage.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar')
PsiWhiteSpace('\n')
PsiErrorElement:Expected annotation identifier after '@file:'
PsiErrorElement:Expected annotation identifier after ':'
PsiElement(AT)('@')
PsiElement(IDENTIFIER)('file')
PsiElement(COLON)(':')
PsiWhiteSpace('\n')
ANNOTATION_ENTRY
PsiElement(AT)('@')
PsiErrorElement:Expected 'file' keyword before ':'
PsiErrorElement:Expected annotation target before ':'
PsiElement(COLON)(':')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
@@ -39,7 +40,7 @@ JetFile: nonFIleAnnotationBeforePackage.kt
PsiWhiteSpace('\n')
ANNOTATION_ENTRY
PsiElement(AT)('@')
PsiErrorElement:Expected 'file' keyword before ':'
PsiErrorElement:Expected annotation target before ':'
PsiElement(IDENTIFIER)('fil')
PsiElement(COLON)(':')
CONSTRUCTOR_CALLEE
+2 -1
View File
@@ -2,7 +2,8 @@ JetFile: single.kt
FILE_ANNOTATION_LIST
ANNOTATION_ENTRY
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
+4 -3
View File
@@ -2,7 +2,8 @@ JetFile: withoutPackage.kt
FILE_ANNOTATION_LIST
ANNOTATION_ENTRY
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
@@ -34,7 +35,7 @@ JetFile: withoutPackage.kt
PsiWhiteSpace('\n')
ANNOTATION
PsiElement(AT)('@')
PsiErrorElement:File annotations are only allowed before package declaration
PsiErrorElement:@file annotations are only allowed before package declaration
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiElement(LBRACKET)('[')
@@ -55,4 +56,4 @@ JetFile: withoutPackage.kt
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
PsiElement(RBRACE)('}')
@@ -2,7 +2,8 @@ JetFile: withoutPackageWithSimpleAnnotation.kt
FILE_ANNOTATION_LIST
ANNOTATION_ENTRY
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
@@ -32,7 +33,7 @@ JetFile: withoutPackageWithSimpleAnnotation.kt
PsiWhiteSpace('\n')
ANNOTATION_ENTRY
PsiElement(AT)('@')
PsiErrorElement:File annotations are only allowed before package declaration
PsiErrorElement:@file annotations are only allowed before package declaration
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
@@ -51,4 +52,4 @@ JetFile: withoutPackageWithSimpleAnnotation.kt
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
PsiElement(RBRACE)('}')
+5 -3
View File
@@ -2,7 +2,8 @@ JetFile: manyAnnotationsOnFile.kts
FILE_ANNOTATION_LIST
ANNOTATION
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiElement(LBRACKET)('[')
PsiWhiteSpace(' ')
@@ -16,7 +17,8 @@ JetFile: manyAnnotationsOnFile.kts
PsiWhiteSpace('\n')
ANNOTATION
PsiElement(AT)('@')
PsiElement(file)('file')
ANNOTATION_TARGET
PsiElement(file)('file')
PsiElement(COLON)(':')
PsiElement(LBRACKET)('[')
ANNOTATION_ENTRY
@@ -43,4 +45,4 @@ JetFile: manyAnnotationsOnFile.kts
<empty list>
SCRIPT
BLOCK
<empty list>
<empty list>