Type annotations
This commit is contained in:
@@ -512,7 +512,7 @@ public class JetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void parseAttributeList() {
|
private void parseAttributeList() {
|
||||||
// TODO
|
while (at(LBRACKET)) parseAttributeAnnotation();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parsePrimaryConstructorParameterList() {
|
private void parsePrimaryConstructorParameterList() {
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
class F(a : [a] [b] B)
|
||||||
|
|
||||||
|
type f = [b] [x] F<[x] A, B>
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
JetFile: TypeAnnotations.jet
|
||||||
|
NAMESPACE
|
||||||
|
CLASS
|
||||||
|
PsiElement(class)('class')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('F')
|
||||||
|
TYPE_PARAMETER_LIST
|
||||||
|
<empty 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
|
||||||
|
<empty 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)('>')
|
||||||
@@ -39,4 +39,5 @@ public class JetParsingTest extends ParsingTestCase {
|
|||||||
public void testAttributes_ERR() throws Exception {doTest(true);}
|
public void testAttributes_ERR() throws Exception {doTest(true);}
|
||||||
public void testTypeDef() throws Exception {doTest(true);}
|
public void testTypeDef() throws Exception {doTest(true);}
|
||||||
public void testTypeDef_ERR() throws Exception {doTest(true);}
|
public void testTypeDef_ERR() throws Exception {doTest(true);}
|
||||||
|
public void testTypeAnnotations() throws Exception {doTest(true);}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user