diff --git a/idea/src/org/jetbrains/jet/lang/parsing/JetParsing.java b/idea/src/org/jetbrains/jet/lang/parsing/JetParsing.java index be9b2e55f64..f6e78dde5c1 100644 --- a/idea/src/org/jetbrains/jet/lang/parsing/JetParsing.java +++ b/idea/src/org/jetbrains/jet/lang/parsing/JetParsing.java @@ -512,7 +512,7 @@ public class JetParsing { } private void parseAttributeList() { - // TODO + while (at(LBRACKET)) parseAttributeAnnotation(); } private void parsePrimaryConstructorParameterList() { diff --git a/idea/testData/psi/TypeAnnotations.jet b/idea/testData/psi/TypeAnnotations.jet new file mode 100644 index 00000000000..c8c948c3f43 --- /dev/null +++ b/idea/testData/psi/TypeAnnotations.jet @@ -0,0 +1,3 @@ +class F(a : [a] [b] B) + +type f = [b] [x] F<[x] A, B> \ No newline at end of file diff --git a/idea/testData/psi/TypeAnnotations.txt b/idea/testData/psi/TypeAnnotations.txt new file mode 100644 index 00000000000..b48778e964f --- /dev/null +++ b/idea/testData/psi/TypeAnnotations.txt @@ -0,0 +1,84 @@ +JetFile: TypeAnnotations.jet + NAMESPACE + CLASS + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('F') + TYPE_PARAMETER_LIST + + PRIMARY_CONSTRUCTOR_PARAMETERS_LIST + PsiElement(LPAR)('(') + PRIMARY_CONSTRUCTOR_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + ATTRIBUTE_ANNOTATION + PsiElement(LBRACKET)('[') + ATTRIBUTE + USER_TYPE + USER_TYPE + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + ATTRIBUTE_ANNOTATION + PsiElement(LBRACKET)('[') + ATTRIBUTE + USER_TYPE + USER_TYPE + PsiElement(IDENTIFIER)('b') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + USER_TYPE + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') + PsiWhiteSpace('\n\n') + TYPEDEF + PsiElement(type)('type') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('f') + PsiWhiteSpace(' ') + TYPE_PARAMETER_LIST + + PsiElement(EQ)('=') + PsiWhiteSpace(' ') + TYPE_REFERENCE + ATTRIBUTE_ANNOTATION + PsiElement(LBRACKET)('[') + ATTRIBUTE + USER_TYPE + USER_TYPE + PsiElement(IDENTIFIER)('b') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + ATTRIBUTE_ANNOTATION + PsiElement(LBRACKET)('[') + ATTRIBUTE + USER_TYPE + USER_TYPE + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + USER_TYPE + PsiElement(IDENTIFIER)('F') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + MODIFIER_LIST + ATTRIBUTE_ANNOTATION + PsiElement(LBRACKET)('[') + ATTRIBUTE + USER_TYPE + USER_TYPE + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + PsiElement(IDENTIFIER)('B') + PsiElement(GT)('>') \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/parsing/JetParsingTest.java b/idea/tests/org/jetbrains/jet/parsing/JetParsingTest.java index ecbbfd25fa8..54485911e95 100644 --- a/idea/tests/org/jetbrains/jet/parsing/JetParsingTest.java +++ b/idea/tests/org/jetbrains/jet/parsing/JetParsingTest.java @@ -39,4 +39,5 @@ public class JetParsingTest extends ParsingTestCase { public void testAttributes_ERR() throws Exception {doTest(true);} public void testTypeDef() throws Exception {doTest(true);} public void testTypeDef_ERR() throws Exception {doTest(true);} + public void testTypeAnnotations() throws Exception {doTest(true);} }