parser tweaks to compensate for removal of static type assertions

This commit is contained in:
Dmitry Jemerov
2015-10-08 19:22:32 +02:00
parent a63d3f5a0f
commit 02a242f15a
10 changed files with 741 additions and 816 deletions
@@ -1074,7 +1074,8 @@ public class JetExpressionParsing extends AbstractJetParsing {
// {a -> ...}
// {a, b -> ...}
PsiBuilder.Marker rollbackMarker = mark();
boolean preferParamsToExpressions = (lookahead(1) == COMMA);
IElementType nextToken = lookahead(1);
boolean preferParamsToExpressions = (nextToken == COMMA || nextToken == COLON);
parseFunctionLiteralShorthandParameterList();
paramsFound = preferParamsToExpressions ?
@@ -1710,6 +1711,9 @@ public class JetExpressionParsing extends AbstractJetParsing {
while (true) {
while (at(COMMA)) errorAndAdvance("Expecting an argument");
parseValueArgument();
if (at(COLON) && lookahead(1) == IDENTIFIER) {
errorAndAdvance("Unexpected type specification", 2);
}
if (!at(COMMA)) break;
advance(); // COMMA
if (at(RPAR)) {
-25
View File
@@ -5,32 +5,7 @@ fun foo() {
{a -> a}
{(a) -> a}
{(a : A) -> a}
{(a : A) : T -> a}
{(a) : T -> a}
{(a, a) -> a}
{(a : A, a : B) -> a}
{(a : A, a) : T -> a}
{(a, a : B) : T -> a}
{() -> a}
{() -> a}
{() : T -> a}
{() : T -> a}
{T.(a) -> a}
{T.(a : A) -> a}
{T.(a : A) : T -> a}
{T.(a) : T -> a}
{x, y -> 1}
{@[a] x, @[b] y, @[c] z -> 1}
{((a: Int = object { fun t() {} }) -> Int).(x: Int) : String -> "" }
{ A.B<String>.(x: Int) -> }
{((a: Boolean = true) -> Int).(x: Any) : Unit -> }
{a: b -> f}
{a: b, c -> f}
-619
View File
@@ -43,422 +43,6 @@ JetFile: FunctionLiterals.kt
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('B')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('B')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PsiErrorElement:Expecting an expression
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PsiErrorElement:Expecting an expression
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
PARENTHESIZED
PsiElement(LPAR)('(')
PsiErrorElement:Expecting an expression
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
PARENTHESIZED
PsiElement(LPAR)('(')
PsiErrorElement:Expecting an expression
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
@@ -476,209 +60,6 @@ JetFile: FunctionLiterals.kt
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
ANNOTATED_EXPRESSION
ANNOTATION
PsiElement(AT)('@')
PsiElement(LBRACKET)('[')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(AT)('@')
PsiElement(LBRACKET)('[')
PsiElement(IDENTIFIER)('b')
PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('y')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(AT)('@')
PsiElement(LBRACKET)('[')
PsiElement(IDENTIFIER)('c')
PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('z')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_EXPRESSION
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
OBJECT_LITERAL
OBJECT_DECLARATION
PsiElement(object)('object')
PsiWhiteSpace(' ')
CLASS_BODY
PsiElement(LBRACE)('{')
PsiWhiteSpace(' ')
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('t')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiElement(RPAR)(')')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(LPAR)('(')
PsiElement(IDENTIFIER)('x')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('String')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(OPEN_QUOTE)('"')
PsiElement(CLOSING_QUOTE)('"')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace(' ')
BLOCK
DOT_QUALIFIED_EXPRESSION
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiElement(DOT)('.')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('B')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('String')
PsiElement(GT)('>')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_EXPRESSION
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Boolean')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
BOOLEAN_CONSTANT
PsiElement(true)('true')
PsiElement(RPAR)(')')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(LPAR)('(')
PsiElement(IDENTIFIER)('x')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Any')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Unit')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
+27
View File
@@ -27,4 +27,31 @@ fun foo() {
{T.(a, b) }
{(a: Int, )}
{a, }
{(a) -> a}
{(a : A) -> a}
{(a : A) : T -> a}
{(a) : T -> a}
{(a, a) -> a}
{(a : A, a : B) -> a}
{(a : A, a) : T -> a}
{(a, a : B) : T -> a}
{() -> a}
{() -> a}
{() : T -> a}
{() : T -> a}
{T.(a) -> a}
{T.(a : A) -> a}
{T.(a : A) : T -> a}
{T.(a) : T -> a}
{@[a] x, @[b] y, @[c] z -> 1}
{((a: Int = object { fun t() {} }) -> Int).(x: Int) : String -> "" }
{ A.B<String>.(x: Int) -> }
{((a: Boolean = true) -> Int).(x: Any) : Unit -> }
}
+642 -129
View File
@@ -50,19 +50,16 @@ JetFile: FunctionLiterals_ERR.kt
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiErrorElement:Type expected
<empty list>
PsiElement(RPAR)(')')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
@@ -72,56 +69,41 @@ JetFile: FunctionLiterals_ERR.kt
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_EXPRESSION
BINARY_WITH_TYPE
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiErrorElement:Type expected
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting an element
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
@@ -152,20 +134,15 @@ JetFile: FunctionLiterals_ERR.kt
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(COMMA)(',')
@@ -188,20 +165,15 @@ JetFile: FunctionLiterals_ERR.kt
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(COMMA)(',')
@@ -260,20 +232,17 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(MINUS)('-')
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
@@ -368,63 +337,62 @@ JetFile: FunctionLiterals_ERR.kt
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
VALUE_PARAMETER_LIST
VALUE_PARAMETER
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
VALUE_PARAMETER
PsiErrorElement:Expecting parameter name
<empty list>
BLOCK
<empty list>
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
VALUE_PARAMETER_LIST
VALUE_PARAMETER
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiErrorElement:Type expected
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
VALUE_PARAMETER
PsiErrorElement:Expecting parameter name
<empty list>
BLOCK
<empty list>
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
BINARY_WITH_TYPE
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('f')
@@ -476,19 +444,14 @@ JetFile: FunctionLiterals_ERR.kt
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(RPAR)(')')
@@ -508,5 +471,555 @@ JetFile: FunctionLiterals_ERR.kt
BLOCK
<empty list>
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('B')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('B')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PsiErrorElement:Expecting an expression
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PsiErrorElement:Expecting an expression
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PsiErrorElement:Expecting an expression
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PsiErrorElement:Expecting an expression
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
ANNOTATED_EXPRESSION
ANNOTATION
PsiElement(AT)('@')
PsiElement(LBRACKET)('[')
ANNOTATION_ENTRY
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(AT)('@')
PsiElement(LBRACKET)('[')
PsiElement(IDENTIFIER)('b')
PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('y')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
PsiElement(AT)('@')
PsiElement(LBRACKET)('[')
PsiElement(IDENTIFIER)('c')
PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('z')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(INTEGER_LITERAL)('1')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiWhiteSpace(' ')
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
PsiElement(object)('object')
PsiWhiteSpace(' ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace(' ')
BLOCK
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('t')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(LPAR)('(')
PsiElement(IDENTIFIER)('x')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('String')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(OPEN_QUOTE)('"')
PsiElement(CLOSING_QUOTE)('"')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace(' ')
BLOCK
DOT_QUALIFIED_EXPRESSION
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('A')
PsiElement(DOT)('.')
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('B')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('String')
PsiElement(GT)('>')
PsiElement(DOT)('.')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
BLOCK
PARENTHESIZED
PsiElement(LPAR)('(')
PARENTHESIZED
PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')'
<empty list>
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Boolean')
PsiWhiteSpace(' ')
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
PsiElement(true)('true')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiElement(DOT)('.')
PsiElement(LPAR)('(')
PsiElement(IDENTIFIER)('x')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Any')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Unit')
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
PsiElement(RBRACE)('}')
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
{a: Int}
}
+35
View File
@@ -0,0 +1,35 @@
JetFile: IncompleteFunctionLiteral.kt
PACKAGE_DIRECTIVE
<empty list>
IMPORT_LIST
<empty list>
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('foo')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST
VALUE_PARAMETER
PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
PsiErrorElement:Expecting '->' or ','
<empty list>
BLOCK
<empty list>
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
+17 -32
View File
@@ -265,17 +265,13 @@ JetFile: TypeExpressionAmbiguities_ERR.kt
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
VALUE_ARGUMENT
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected type specification
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('b')
PsiElement(COMMA)(',')
PsiWhiteSpace(' ')
VALUE_ARGUMENT
@@ -291,28 +287,17 @@ JetFile: TypeExpressionAmbiguities_ERR.kt
PsiElement(RPAR)(')')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n ')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line)
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace(' ')
TYPE_ARGUMENT_LIST
PsiElement(LT)('<')
PsiWhiteSpace(' ')
TYPE_PROJECTION
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('c')
PsiErrorElement:Expecting a '>'
<empty list>
PsiElement(LT)('<')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('c')
PsiWhiteSpace('\n ')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
@@ -360,4 +345,4 @@ JetFile: TypeExpressionAmbiguities_ERR.kt
PsiErrorElement:Expecting a '>'
<empty list>
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
PsiElement(RBRACE)('}')
+6 -10
View File
@@ -21,16 +21,12 @@ JetFile: recovery.kt
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
PsiErrorElement:Unexpected type specification
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiErrorElement:Expecting 'constructor' keyword
<empty list>
@@ -451,6 +451,12 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest {
doParsingTest(fileName);
}
@TestMetadata("IncompleteFunctionLiteral.kt")
public void testIncompleteFunctionLiteral() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/IncompleteFunctionLiteral.kt");
doParsingTest(fileName);
}
@TestMetadata("Inner.kt")
public void testInner() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/Inner.kt");