From 7bfa4a9c092628629f9b721e8d07f55f560aebbf Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Mon, 18 Mar 2013 22:01:45 +0400 Subject: [PATCH] Removed tuples from PSI tests. --- compiler/testData/psi/FunctionTypes.jet | 20 +- compiler/testData/psi/FunctionTypes.txt | 65 +-- compiler/testData/psi/LocalDeclarations.jet | 2 +- compiler/testData/psi/LocalDeclarations.txt | 7 +- compiler/testData/psi/SimpleExpressions.jet | 5 +- compiler/testData/psi/SimpleExpressions.txt | 49 +- compiler/testData/psi/TupleTypes.jet | 10 - compiler/testData/psi/TupleTypes.txt | 264 --------- compiler/testData/psi/TupleTypes_ERR.jet | 10 - compiler/testData/psi/TupleTypes_ERR.txt | 263 --------- .../testData/psi/TuplesWithLabeledEntries.jet | 2 - .../testData/psi/TuplesWithLabeledEntries.txt | 44 -- .../psi/TypeExpressionAmbiguities_ERR.jet | 2 +- .../psi/TypeExpressionAmbiguities_ERR.txt | 111 ++-- compiler/testData/psi/When.jet | 2 +- compiler/testData/psi/When.txt | 32 +- compiler/testData/psi/When_ERR.jet | 1 - compiler/testData/psi/When_ERR.txt | 27 - .../psi/examples/FunctionsAndTypes.jet | 4 +- .../psi/examples/FunctionsAndTypes.txt | 39 +- .../greatSyntacticShift/functionLiterals.jet | 6 +- .../greatSyntacticShift/functionLiterals.txt | 526 +++++++++--------- 22 files changed, 451 insertions(+), 1040 deletions(-) delete mode 100644 compiler/testData/psi/TupleTypes.jet delete mode 100644 compiler/testData/psi/TupleTypes.txt delete mode 100644 compiler/testData/psi/TupleTypes_ERR.jet delete mode 100644 compiler/testData/psi/TupleTypes_ERR.txt delete mode 100644 compiler/testData/psi/TuplesWithLabeledEntries.jet delete mode 100644 compiler/testData/psi/TuplesWithLabeledEntries.txt diff --git a/compiler/testData/psi/FunctionTypes.jet b/compiler/testData/psi/FunctionTypes.jet index 5d5ffc415a7..66ff24f8e26 100644 --- a/compiler/testData/psi/FunctionTypes.jet +++ b/compiler/testData/psi/FunctionTypes.jet @@ -1,24 +1,24 @@ type f = ([a] a) -> b type f = (a) -> b type f = () -> [x] b -type f = () -> #() +type f = () -> Unit type f = (a : [a] a) -> b type f = (a : a) -> b type f = () -> b -type f = () -> #() +type f = () -> Unit type f = (a : [a] a, foo, x : bar) -> b type f = (foo, a : a) -> b type f = (foo, a : (a) -> b) -> b -type f = (foo, a : (a) -> b) -> () -> #() +type f = (foo, a : (a) -> b) -> () -> Unit -//type f = (ref foo, ref a : (ref a) -> b) -> () -> #() +//type f = (ref foo, ref a : (ref a) -> b) -> () -> Unit -type f = T.() -> #() -type f = T.T.() -> #() -type f = T.T.() -> #() +type f = T.() -> Unit +type f = T.T.() -> Unit +type f = T.T.() -> Unit -type f = [a] T.() -> #() -type f = [a] T.T.() -> #() -type f = [a] T.T.() -> #() +type f = [a] T.() -> Unit +type f = [a] T.T.() -> Unit +type f = [a] T.T.() -> Unit diff --git a/compiler/testData/psi/FunctionTypes.txt b/compiler/testData/psi/FunctionTypes.txt index bb0e541051f..3fadc731911 100644 --- a/compiler/testData/psi/FunctionTypes.txt +++ b/compiler/testData/psi/FunctionTypes.txt @@ -116,10 +116,9 @@ JetFile: FunctionTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n\n') TYPEDEF PsiElement(type)('type') @@ -233,10 +232,9 @@ JetFile: FunctionTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n\n') TYPEDEF PsiElement(type)('type') @@ -441,12 +439,11 @@ JetFile: FunctionTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n\n') - PsiComment(EOL_COMMENT)('//type f = (ref foo, ref a : (ref a) -> b) -> () -> #()') + PsiComment(EOL_COMMENT)('//type f = (ref foo, ref a : (ref a) -> b) -> () -> Unit') PsiWhiteSpace('\n\n') TYPEDEF PsiElement(type)('type') @@ -472,10 +469,9 @@ JetFile: FunctionTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n') TYPEDEF PsiElement(type)('type') @@ -505,10 +501,9 @@ JetFile: FunctionTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n') TYPEDEF PsiElement(type)('type') @@ -561,10 +556,9 @@ JetFile: FunctionTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n\n') TYPEDEF PsiElement(type)('type') @@ -600,10 +594,9 @@ JetFile: FunctionTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n') TYPEDEF PsiElement(type)('type') @@ -643,10 +636,9 @@ JetFile: FunctionTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n') TYPEDEF PsiElement(type)('type') @@ -709,7 +701,6 @@ JetFile: FunctionTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') \ No newline at end of file + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') \ No newline at end of file diff --git a/compiler/testData/psi/LocalDeclarations.jet b/compiler/testData/psi/LocalDeclarations.jet index 4254634f0e5..ea2b188f94c 100644 --- a/compiler/testData/psi/LocalDeclarations.jet +++ b/compiler/testData/psi/LocalDeclarations.jet @@ -6,6 +6,6 @@ fun foo() { out val foo = 5 [a] var foo = 4 - type f = T.() -> #() + type f = T.() -> Unit } diff --git a/compiler/testData/psi/LocalDeclarations.txt b/compiler/testData/psi/LocalDeclarations.txt index bafc7e90c8e..43691d7d76d 100644 --- a/compiler/testData/psi/LocalDeclarations.txt +++ b/compiler/testData/psi/LocalDeclarations.txt @@ -124,9 +124,8 @@ JetFile: LocalDeclarations.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/SimpleExpressions.jet b/compiler/testData/psi/SimpleExpressions.jet index 4e931bb6945..c1d311829d3 100644 --- a/compiler/testData/psi/SimpleExpressions.jet +++ b/compiler/testData/psi/SimpleExpressions.jet @@ -1,6 +1,5 @@ - fun a( - a : foo = #(), + a : foo = Unit.VALUE, a : foo = 10, a : foo = 0x10, a : foo = '1', @@ -17,7 +16,7 @@ fun a( a : foo = this, a : foo = super, a : foo = (10), - a : foo = #(10, "A", 0xf), + a : foo = Triple(10, "A", 0xf), a : foo = Foo(bar), a : foo = Foo(bar), a : foo = Foo(), diff --git a/compiler/testData/psi/SimpleExpressions.txt b/compiler/testData/psi/SimpleExpressions.txt index 99333f8a1b8..db8b92fd064 100644 --- a/compiler/testData/psi/SimpleExpressions.txt +++ b/compiler/testData/psi/SimpleExpressions.txt @@ -20,10 +20,12 @@ JetFile: SimpleExpressions.jet PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - TUPLE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('VALUE') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') VALUE_PARAMETER @@ -327,23 +329,28 @@ JetFile: SimpleExpressions.jet PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - TUPLE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('10') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - STRING_TEMPLATE - PsiElement(OPEN_QUOTE)('"') - LITERAL_STRING_TEMPLATE_ENTRY - PsiElement(REGULAR_STRING_PART)('A') - PsiElement(CLOSING_QUOTE)('"') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('0xf') - PsiElement(RPAR)(')') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Triple') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('10') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + STRING_TEMPLATE + PsiElement(OPEN_QUOTE)('"') + LITERAL_STRING_TEMPLATE_ENTRY + PsiElement(REGULAR_STRING_PART)('A') + PsiElement(CLOSING_QUOTE)('"') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('0xf') + PsiElement(RPAR)(')') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') VALUE_PARAMETER diff --git a/compiler/testData/psi/TupleTypes.jet b/compiler/testData/psi/TupleTypes.jet deleted file mode 100644 index 930344a9c8f..00000000000 --- a/compiler/testData/psi/TupleTypes.jet +++ /dev/null @@ -1,10 +0,0 @@ -class F( - a : #(), - x : #(X), - b : #(A, B), - c : #(x : Int, y : Int), - a : [x] #(), - x : [x]#([x] X), - b : [x] #([x] A, [x]B), - c : [x] #(x : [x] Int, y : [x] Int) - ) \ No newline at end of file diff --git a/compiler/testData/psi/TupleTypes.txt b/compiler/testData/psi/TupleTypes.txt deleted file mode 100644 index 4fc657eadf2..00000000000 --- a/compiler/testData/psi/TupleTypes.txt +++ /dev/null @@ -1,264 +0,0 @@ -JetFile: TupleTypes.jet - NAMESPACE_HEADER - - CLASS - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('F') - TYPE_PARAMETER_LIST - - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('c') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - LABELED_TUPLE_TYPE_ENTRY - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - LABELED_TUPLE_TYPE_ENTRY - PsiElement(IDENTIFIER)('y') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('c') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - LABELED_TUPLE_TYPE_ENTRY - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - LABELED_TUPLE_TYPE_ENTRY - PsiElement(IDENTIFIER)('y') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/TupleTypes_ERR.jet b/compiler/testData/psi/TupleTypes_ERR.jet deleted file mode 100644 index c4e70baf21f..00000000000 --- a/compiler/testData/psi/TupleTypes_ERR.jet +++ /dev/null @@ -1,10 +0,0 @@ -class F( - a : #(), - x : #(X), - b : #(A, ), - c : #(x : , : Int), - a : [x] #(), - x : [x]#([x X), - b : [x] #([x] A, [x]B), - c : [x] #(x : [x] Int, y : [x] Int) - ) \ No newline at end of file diff --git a/compiler/testData/psi/TupleTypes_ERR.txt b/compiler/testData/psi/TupleTypes_ERR.txt deleted file mode 100644 index 03e59a23184..00000000000 --- a/compiler/testData/psi/TupleTypes_ERR.txt +++ /dev/null @@ -1,263 +0,0 @@ -JetFile: TupleTypes_ERR.jet - NAMESPACE_HEADER - - CLASS - PsiElement(class)('class') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('F') - TYPE_PARAMETER_LIST - - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiErrorElement:Type expected - - PsiWhiteSpace(' ') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('c') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - LABELED_TUPLE_TYPE_ENTRY - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - PsiErrorElement:Type expected - - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a name for tuple entry - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('X') - PsiErrorElement:Expecting ']' to close an attribute annotation - - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') - PsiElement(COMMA)(',') - PsiWhiteSpace('\n ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('c') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - LABELED_TUPLE_TYPE_ENTRY - PsiElement(IDENTIFIER)('x') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - LABELED_TUPLE_TYPE_ENTRY - PsiElement(IDENTIFIER)('y') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n ') - PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/TuplesWithLabeledEntries.jet b/compiler/testData/psi/TuplesWithLabeledEntries.jet deleted file mode 100644 index c03fa82a256..00000000000 --- a/compiler/testData/psi/TuplesWithLabeledEntries.jet +++ /dev/null @@ -1,2 +0,0 @@ -val foo = #(a = 3) -val foo = #(a = 3, a) \ No newline at end of file diff --git a/compiler/testData/psi/TuplesWithLabeledEntries.txt b/compiler/testData/psi/TuplesWithLabeledEntries.txt deleted file mode 100644 index da00ea46357..00000000000 --- a/compiler/testData/psi/TuplesWithLabeledEntries.txt +++ /dev/null @@ -1,44 +0,0 @@ -JetFile: TuplesWithLabeledEntries.jet - NAMESPACE_HEADER - - PROPERTY - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TUPLE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - LABELED_TUPLE_ENTRY - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('3') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n') - PROPERTY - PsiElement(val)('val') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - TUPLE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - LABELED_TUPLE_ENTRY - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(EQ)('=') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('3') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/TypeExpressionAmbiguities_ERR.jet b/compiler/testData/psi/TypeExpressionAmbiguities_ERR.jet index 5050788b08c..2c9f541a385 100644 --- a/compiler/testData/psi/TypeExpressionAmbiguities_ERR.jet +++ b/compiler/testData/psi/TypeExpressionAmbiguities_ERR.jet @@ -1,7 +1,7 @@ fun foo() { foo() fooo() - dd<#(Int, Int, Int)>(if (true) #(1, 1, 1) else #(2, 2, 2)) + dd>(if (true) Triple(1, 1, 1) else Triple(2, 2, 2)) foo(bar(d)) foo(bar(d)) foo(bar(d)) diff --git a/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt b/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt index 9490dc7e263..5d776f8880f 100644 --- a/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt +++ b/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt @@ -50,26 +50,31 @@ JetFile: TypeExpressionAmbiguities_ERR.jet PsiElement(LT)('<') TYPE_PROJECTION TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Triple') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(GT)('>') PsiElement(GT)('>') VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') @@ -84,38 +89,48 @@ JetFile: TypeExpressionAmbiguities_ERR.jet PsiElement(RPAR)(')') PsiWhiteSpace(' ') THEN - TUPLE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RPAR)(')') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Triple') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(else)('else') PsiWhiteSpace(' ') ELSE - TUPLE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('2') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('2') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('2') - PsiElement(RPAR)(')') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Triple') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('2') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('2') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + INTEGER_CONSTANT + PsiElement(INTEGER_LITERAL)('2') + PsiElement(RPAR)(')') PsiElement(RPAR)(')') PsiWhiteSpace('\n ') CALL_EXPRESSION diff --git a/compiler/testData/psi/When.jet b/compiler/testData/psi/When.jet index 17330c73d72..268723bf3ed 100644 --- a/compiler/testData/psi/When.jet +++ b/compiler/testData/psi/When.jet @@ -43,7 +43,7 @@ fun foo() { !in 2 -> sd !is t -> d (foo) -> Bar -> fgpp - is #(Int, Int) -> 2 + is Pair -> 2 else -> foo } } diff --git a/compiler/testData/psi/When.txt b/compiler/testData/psi/When.txt index 56e7d64ee0c..3e14592e6bb 100644 --- a/compiler/testData/psi/When.txt +++ b/compiler/testData/psi/When.txt @@ -457,20 +457,24 @@ JetFile: When.jet PsiElement(is)('is') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Pair') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiElement(GT)('>') PsiWhiteSpace(' ') PsiElement(ARROW)('->') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/When_ERR.jet b/compiler/testData/psi/When_ERR.jet index 4cd6af25998..f6a5e6b460c 100644 --- a/compiler/testData/psi/When_ERR.jet +++ b/compiler/testData/psi/When_ERR.jet @@ -21,6 +21,5 @@ fun foo() { } when (e) { - -> foo - #(, , 1, , ) -> foo } } \ No newline at end of file diff --git a/compiler/testData/psi/When_ERR.txt b/compiler/testData/psi/When_ERR.txt index a91548b2518..1eb95474699 100644 --- a/compiler/testData/psi/When_ERR.txt +++ b/compiler/testData/psi/When_ERR.txt @@ -205,33 +205,6 @@ JetFile: When_ERR.jet PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') - PsiWhiteSpace('\n ') - WHEN_ENTRY - WHEN_CONDITION_WITH_EXPRESSION - TUPLE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiErrorElement:Expecting a tuple entry (element) - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a tuple entry (element) - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - PsiErrorElement:Expecting a tuple entry (element) - PsiElement(COMMA)(',') - PsiErrorElement:Expecting an expression - - PsiWhiteSpace(' ') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n') diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.jet b/compiler/testData/psi/examples/FunctionsAndTypes.jet index c8d79fed6e8..41313ae0374 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.jet +++ b/compiler/testData/psi/examples/FunctionsAndTypes.jet @@ -2,7 +2,7 @@ type f1 = (T) -> X // type f1 = {(T) => X} type f2 = (T, E) -> X // type f2 = {(T, E) => X} -type f_tuple = (#(T, E)) -> X +type f_tuple = (Pair) -> X //type f_tuple = {((T, E)) => X} type hof = (X) -> (T) -> Y //type hof = { (X) => {(T) => Y} } @@ -16,7 +16,7 @@ type Equality = (a : T, b : T) -> Boolean //type Equality = {(a : T, b : T) => Boolean} type HashFunction = (obj : T) -> Int //type HashFunction = {(obj : T) => Int} -type Runnable = () -> #() +type Runnable = () -> Unit //type Runnable = {() => ()} type Function1 = (input : T) -> R //type Function1 = {(input : T) => R} diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.txt b/compiler/testData/psi/examples/FunctionsAndTypes.txt index e285dc8a3f0..5c394031a67 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.txt +++ b/compiler/testData/psi/examples/FunctionsAndTypes.txt @@ -81,20 +81,24 @@ JetFile: FunctionsAndTypes.jet PsiElement(LPAR)('(') VALUE_PARAMETER TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('E') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Pair') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('E') + PsiElement(GT)('>') PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(ARROW)('->') @@ -361,10 +365,9 @@ JetFile: FunctionsAndTypes.jet PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiWhiteSpace('\n') PsiComment(EOL_COMMENT)('//type Runnable = {() => ()}') PsiWhiteSpace('\n') diff --git a/compiler/testData/psi/greatSyntacticShift/functionLiterals.jet b/compiler/testData/psi/greatSyntacticShift/functionLiterals.jet index 345d07943ad..d285bdd7e8f 100644 --- a/compiler/testData/psi/greatSyntacticShift/functionLiterals.jet +++ b/compiler/testData/psi/greatSyntacticShift/functionLiterals.jet @@ -30,9 +30,9 @@ a(1 , {(Int).(x, y) : (Int) -> Int -> {1}} , {Int? .(x, y) -> 1} , {This.(x, y) -> 1} -, {#(A, B).(x, y) -> 1} -, {#(a, b).(y)} -, {#(a, b)} +, {Pair(A, B).(x, y) -> 1} +, {Pair(a, b).(y)} +, {Pair(a, b)} , {Foo.x} , {Foo.(x)} , {Foo.(x) -> x} diff --git a/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt index 8d98dcae65a..d6e01562812 100644 --- a/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt +++ b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt @@ -672,90 +672,6 @@ JetFile: functionLiterals.jet PsiWhiteSpace('\n') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - TUPLE_TYPE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('B') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT - PsiElement(INTEGER_LITERAL)('1') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - DOT_QUALIFIED_EXPRESSION - TUPLE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') - PsiElement(DOT)('.') - PARENTHESIZED - PsiElement(LPAR)('(') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('y') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - TUPLE - PsiElement(HASH)('#') - PsiElement(LPAR)('(') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') VALUE_ARGUMENT FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL @@ -764,189 +680,287 @@ JetFile: functionLiterals.jet DOT_QUALIFIED_EXPRESSION CALL_EXPRESSION REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(GT)('>') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - BLOCK - DOT_QUALIFIED_EXPRESSION - CALL_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(GT)('>') + PsiElement(IDENTIFIER)('Pair') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('A') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('B') + PsiElement(RPAR)(')') PsiElement(DOT)('.') PARENTHESIZED PsiElement(LPAR)('(') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE + PsiErrorElement:Expecting ')' + + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiErrorElement:Expecting an element + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + DOT_QUALIFIED_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Pair') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('y') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiErrorElement:Expecting an element + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Pair') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiErrorElement:Expecting an element + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + DOT_QUALIFIED_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiElement(GT)('>') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiErrorElement:Expecting an element + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + DOT_QUALIFIED_EXPRESSION + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + TYPE_ARGUMENT_LIST + PsiElement(LT)('<') + TYPE_PROJECTION + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiElement(GT)('>') + PsiElement(DOT)('.') + PARENTHESIZED + PsiElement(LPAR)('(') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiErrorElement:Expecting an element + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + 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)('>') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiErrorElement:Expecting an element + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Bar') - PsiElement(GT)('>') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - USER_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Baz') PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Baz') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') - TYPE_ARGUMENT_LIST - PsiElement(LT)('<') - TYPE_PROJECTION - TYPE_REFERENCE + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiErrorElement:Expecting an element + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + 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)('>') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiErrorElement:Expecting an element + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Foo') + PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Bar') - PsiElement(GT)('>') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - USER_TYPE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Foo') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Baz') PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Baz') - PsiElement(DOT)('.') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('x') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace(' ') - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('x') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + VALUE_PARAMETER + PsiElement(IDENTIFIER)('x') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Int') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiErrorElement:Expecting an element + PsiElement(RPAR)(')') + PsiWhiteSpace('\n') PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(RPAR)(')') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') \ No newline at end of file + PsiErrorElement:Expecting ')' + + PsiErrorElement:Expecting '} + \ No newline at end of file