Parser recovers on platform types notation:
- Foo! - Array<(out) Foo>! - (Mutable)List<Foo>!
This commit is contained in:
@@ -113,9 +113,7 @@ import static org.jetbrains.jet.lexer.JetTokens.*;
|
||||
|
||||
protected boolean errorAndAdvance(String message, int advanceTokenCount) {
|
||||
PsiBuilder.Marker err = mark();
|
||||
for (int i = 0; i < advanceTokenCount; i++) {
|
||||
advance(); // erroneous token
|
||||
}
|
||||
advance(advanceTokenCount);
|
||||
err.error(message);
|
||||
return false;
|
||||
}
|
||||
@@ -129,6 +127,12 @@ import static org.jetbrains.jet.lexer.JetTokens.*;
|
||||
myBuilder.advanceLexer();
|
||||
}
|
||||
|
||||
protected void advance(int advanceTokenCount) {
|
||||
for (int i = 0; i < advanceTokenCount; i++) {
|
||||
advance(); // erroneous token
|
||||
}
|
||||
}
|
||||
|
||||
protected void advanceAt(IElementType current) {
|
||||
assert _at(current);
|
||||
myBuilder.advanceLexer();
|
||||
|
||||
@@ -1488,7 +1488,7 @@ public class JetParsing extends AbstractJetParsing {
|
||||
PsiBuilder.Marker typeRefMarker = mark();
|
||||
parseAnnotations(REGULAR_ANNOTATIONS_ONLY_WITH_BRACKETS);
|
||||
|
||||
if (at(IDENTIFIER) || at(PACKAGE_KEYWORD)) {
|
||||
if (at(IDENTIFIER) || at(PACKAGE_KEYWORD) || atParenthesizedMutableForPlatformTypes(0)) {
|
||||
parseUserType();
|
||||
}
|
||||
else if (at(HASH)) {
|
||||
@@ -1577,6 +1577,11 @@ public class JetParsing extends AbstractJetParsing {
|
||||
* userType
|
||||
* : ("package" ".")? simpleUserType{"."}
|
||||
* ;
|
||||
*
|
||||
* recovers on platform types:
|
||||
* - Foo!
|
||||
* - (Mutable)List<Foo>!
|
||||
* - Array<(out) Foo>!
|
||||
*/
|
||||
void parseUserType() {
|
||||
PsiBuilder.Marker userType = mark();
|
||||
@@ -1588,6 +1593,8 @@ public class JetParsing extends AbstractJetParsing {
|
||||
|
||||
PsiBuilder.Marker reference = mark();
|
||||
while (true) {
|
||||
recoverOnParenthesizedWordForPlatformTypes(0, "Mutable", true);
|
||||
|
||||
if (expect(IDENTIFIER, "Expecting type name",
|
||||
TokenSet.orSet(JetExpressionParsing.EXPRESSION_FIRST, JetExpressionParsing.EXPRESSION_FOLLOW))) {
|
||||
reference.done(REFERENCE_EXPRESSION);
|
||||
@@ -1598,10 +1605,13 @@ public class JetParsing extends AbstractJetParsing {
|
||||
}
|
||||
|
||||
parseTypeArgumentList();
|
||||
|
||||
recoverOnPlatformTypeSuffix();
|
||||
|
||||
if (!at(DOT)) {
|
||||
break;
|
||||
}
|
||||
if (lookahead(1) == LPAR) {
|
||||
if (lookahead(1) == LPAR && !atParenthesizedMutableForPlatformTypes(1)) {
|
||||
// This may be a receiver for a function type
|
||||
// Int.(Int) -> Int
|
||||
break;
|
||||
@@ -1618,6 +1628,49 @@ public class JetParsing extends AbstractJetParsing {
|
||||
userType.done(USER_TYPE);
|
||||
}
|
||||
|
||||
private boolean atParenthesizedMutableForPlatformTypes(int offset) {
|
||||
return recoverOnParenthesizedWordForPlatformTypes(offset, "Mutable", false);
|
||||
}
|
||||
|
||||
private boolean recoverOnParenthesizedWordForPlatformTypes(int offset, String word, boolean consume) {
|
||||
// Array<(out) Foo>! or (Mutable)List<Bar>!
|
||||
if (lookahead(offset) == LPAR && lookahead(offset + 1) == IDENTIFIER && lookahead(offset + 2) == RPAR && lookahead(offset + 3) == IDENTIFIER) {
|
||||
PsiBuilder.Marker error = mark();
|
||||
|
||||
advance(offset);
|
||||
|
||||
advance(); // LPAR
|
||||
if (!word.equals(myBuilder.getTokenText())) {
|
||||
// something other than "out" / "Mutable"
|
||||
error.rollbackTo();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
advance(); // IDENTIFIER('out')
|
||||
advance(); // RPAR
|
||||
|
||||
if (consume) {
|
||||
error.error("Unexpected tokens");
|
||||
}
|
||||
else {
|
||||
error.rollbackTo();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void recoverOnPlatformTypeSuffix() {
|
||||
// Recovery for platform types
|
||||
if (at(EXCL)) {
|
||||
PsiBuilder.Marker error = mark();
|
||||
advance(); // EXCL
|
||||
error.error("Unexpected token");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* selfType
|
||||
* : "This"
|
||||
@@ -1652,6 +1705,8 @@ public class JetParsing extends AbstractJetParsing {
|
||||
while (true) {
|
||||
PsiBuilder.Marker projection = mark();
|
||||
|
||||
recoverOnParenthesizedWordForPlatformTypes(0, "out", true);
|
||||
|
||||
// TokenSet lookFor = TokenSet.create(IDENTIFIER);
|
||||
// TokenSet stopAt = TokenSet.create(COMMA, COLON, GT);
|
||||
// parseModifierListWithShortAnnotations(MODIFIER_LIST, lookFor, stopAt);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(
|
||||
p: Array<(out) Foo>!,
|
||||
p1: Array<(out) Foo!>!,
|
||||
p1: Array<(out) Array<(out) Foo>!>!
|
||||
) {}
|
||||
@@ -0,0 +1,106 @@
|
||||
JetFile: Array.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Array')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('out')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p1')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Array')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('out')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p1')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Array')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('out')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Array')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('out')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(
|
||||
p: Foo!.Bar,
|
||||
p: Foo<Bar>!.Baz,
|
||||
p1: Foo!.() -> Unit
|
||||
) {}
|
||||
@@ -0,0 +1,80 @@
|
||||
JetFile: BeforeDot.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Baz')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p1')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(DOT)('.')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Unit')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo(
|
||||
p: (Mutable)List<Foo>!,
|
||||
p1: (Mutable)Iterable<Foo>!,
|
||||
p2: Foo<(Mutable)List<Foo!>!>,
|
||||
p3: (Mutable)Set<(Mutable)List<Foo!>!>
|
||||
) {}
|
||||
@@ -0,0 +1,134 @@
|
||||
JetFile: Collections.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('List')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p1')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('Iterable')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p2')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('List')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p3')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('Set')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('List')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo(f: (Mutable) -> Unit) {}
|
||||
fun foo(f: T.(Mutable) -> Unit) {}
|
||||
fun foo(f: Array<(out) -> Unit>) {}
|
||||
fun foo(f: Array<T.(out) -> Unit>) {}
|
||||
@@ -0,0 +1,164 @@
|
||||
JetFile: FunctionsNotPlatform.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Unit')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Unit')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Array')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
MODIFIER_LIST
|
||||
PsiElement(out)('out')
|
||||
TYPE_REFERENCE
|
||||
PsiErrorElement:Type expected
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Unit')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Array')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
FUNCTION_TYPE
|
||||
FUNCTION_TYPE_RECEIVER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(DOT)('.')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
MODIFIER_LIST
|
||||
PsiElement(out)('out')
|
||||
TYPE_REFERENCE
|
||||
PsiErrorElement:Type expected
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Unit')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo(
|
||||
p: (Mutable)Map.(Mutable)Entry<Foo, Bar!>!,
|
||||
p: kotlin.(Mutable)Map.(Mutable)Entry<Foo, Bar!>!,
|
||||
) {}
|
||||
@@ -0,0 +1,103 @@
|
||||
JetFile: MapEntry.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('Map')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('Entry')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('kotlin')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('Map')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('Entry')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiErrorElement:Expecting a parameter declaration
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -0,0 +1,2 @@
|
||||
fun foo(f: (Mutable)) {}
|
||||
fun foo(f: Array<(out)>) {}
|
||||
@@ -0,0 +1,54 @@
|
||||
JetFile: ParenthesizedNotPlatform.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
PsiElement(LPAR)('(')
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Array')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
PsiElement(LPAR)('(')
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('out')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(
|
||||
p: qualified.Type!,
|
||||
p1: qualified.Foo<qualified.Type!, qualified.Type!>,
|
||||
p2: qualified.Foo<qualified.Type>!
|
||||
) {}
|
||||
@@ -0,0 +1,99 @@
|
||||
JetFile: Qualified.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('qualified')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Type')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p1')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('qualified')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('qualified')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Type')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('qualified')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Type')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p2')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('qualified')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('qualified')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Type')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -0,0 +1,6 @@
|
||||
fun foo(
|
||||
p: kotlin.(Mutable)List<Foo>!,
|
||||
p1: kotlin.(Mutable)Iterable<Foo>!,
|
||||
p2: Foo<kotlin.(Mutable)List<Foo!>!>,
|
||||
p2: kotlin.(Mutable)Set<kotlin.(Mutable)List<Foo!>!>
|
||||
) {}
|
||||
@@ -0,0 +1,154 @@
|
||||
JetFile: QualifiedCollections.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('kotlin')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('List')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p1')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('kotlin')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('Iterable')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p2')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('kotlin')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('List')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p2')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('kotlin')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('Set')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('kotlin')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiErrorElement:Unexpected tokens
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('Mutable')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(IDENTIFIER)('List')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(
|
||||
p: Type!,
|
||||
p1: Foo<Type!, Type!>,
|
||||
p2: Foo<Type>!
|
||||
) {}
|
||||
@@ -0,0 +1,75 @@
|
||||
JetFile: Simple.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Type')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p1')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Type')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Type')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(GT)('>')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p2')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Type')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -0,0 +1,4 @@
|
||||
fun foo(
|
||||
p: (Foo)List<Bar>!,
|
||||
p1: Array<(foo) Bar>!
|
||||
) {}
|
||||
@@ -0,0 +1,75 @@
|
||||
JetFile: WrongWordInParentheses.kt
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
PsiElement(LPAR)('(')
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting comma or ')'
|
||||
<empty list>
|
||||
VALUE_PARAMETER
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('List')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Unexpected token
|
||||
PsiElement(EXCL)('!')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('p1')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('Array')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_PROJECTION
|
||||
TYPE_REFERENCE
|
||||
PsiElement(LPAR)('(')
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting a '>'
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_PARAMETER
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiErrorElement:Parameters must have type annotation
|
||||
PsiElement(GT)('>')
|
||||
PsiErrorElement:Expecting comma or ')'
|
||||
<empty list>
|
||||
PsiErrorElement:Expecting ')'
|
||||
PsiElement(EXCL)('!')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiErrorElement:Expecting package directive or top level declaration
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting package directive or top level declaration
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiErrorElement:Expecting package directive or top level declaration
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -35,7 +35,7 @@ import java.util.regex.Pattern;
|
||||
public class JetParsingTestGenerated extends AbstractJetParsingTest {
|
||||
@TestMetadata("compiler/testData/psi")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@InnerTestClasses({Psi.Annotation.class, Psi.Examples.class, Psi.FunctionReceivers.class, Psi.GreatSyntacticShift.class, Psi.Kdoc.class, Psi.PropertyDelegate.class, Psi.Recovery.class, Psi.Script.class, Psi.StringTemplates.class})
|
||||
@InnerTestClasses({Psi.Annotation.class, Psi.Examples.class, Psi.FunctionReceivers.class, Psi.GreatSyntacticShift.class, Psi.Kdoc.class, Psi.PlatformTypesRecovery.class, Psi.PropertyDelegate.class, Psi.Recovery.class, Psi.Script.class, Psi.StringTemplates.class})
|
||||
@RunWith(org.jetbrains.jet.JUnit3RunnerWithInners.class)
|
||||
public static class Psi extends AbstractJetParsingTest {
|
||||
@TestMetadata("AbsentInnerType.kt")
|
||||
@@ -1028,6 +1028,76 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest {
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/psi/platformTypesRecovery")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(org.jetbrains.jet.JUnit3RunnerWithInners.class)
|
||||
public static class PlatformTypesRecovery extends AbstractJetParsingTest {
|
||||
public void testAllFilesPresentInPlatformTypesRecovery() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/psi/platformTypesRecovery"), Pattern.compile("^(.*)\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("Array.kt")
|
||||
public void testArray() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/Array.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("BeforeDot.kt")
|
||||
public void testBeforeDot() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/BeforeDot.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Collections.kt")
|
||||
public void testCollections() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/Collections.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("FunctionsNotPlatform.kt")
|
||||
public void testFunctionsNotPlatform() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/FunctionsNotPlatform.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("MapEntry.kt")
|
||||
public void testMapEntry() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/MapEntry.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ParenthesizedNotPlatform.kt")
|
||||
public void testParenthesizedNotPlatform() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/ParenthesizedNotPlatform.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Qualified.kt")
|
||||
public void testQualified() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/Qualified.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("QualifiedCollections.kt")
|
||||
public void testQualifiedCollections() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/QualifiedCollections.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/Simple.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("WrongWordInParentheses.kt")
|
||||
public void testWrongWordInParentheses() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/platformTypesRecovery/WrongWordInParentheses.kt");
|
||||
doParsingTest(fileName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/psi/propertyDelegate")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(org.jetbrains.jet.JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user