From 91d10790b486085e63a52ad44d0d2827abb56739 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 21 Dec 2011 10:57:09 +0200 Subject: [PATCH] GreatSyntacticShift: Parser test data fixed --- compiler/testData/psi/Attributes.jet | 2 +- compiler/testData/psi/Attributes.txt | 2 +- .../testData/psi/AttributesOnPatterns.jet | 12 +- .../testData/psi/AttributesOnPatterns.txt | 17 +- compiler/testData/psi/Attributes_ERR.jet | 2 +- compiler/testData/psi/Attributes_ERR.txt | 2 +- compiler/testData/psi/BabySteps.jet | 2 +- compiler/testData/psi/BabySteps.txt | 2 +- compiler/testData/psi/BabySteps_ERR.jet | 2 +- compiler/testData/psi/BabySteps_ERR.txt | 2 +- compiler/testData/psi/CallsInWhen.jet | 18 +- compiler/testData/psi/CallsInWhen.txt | 20 +- compiler/testData/psi/FileStart_ERR.jet | 2 +- compiler/testData/psi/FileStart_ERR.txt | 2 +- compiler/testData/psi/FunctionLiterals.jet | 38 +-- compiler/testData/psi/FunctionLiterals.txt | 113 ++++----- .../testData/psi/FunctionLiterals_ERR.jet | 24 +- .../testData/psi/FunctionLiterals_ERR.txt | 224 ++++++++++-------- compiler/testData/psi/FunctionTypes.jet | 38 +-- compiler/testData/psi/FunctionTypes.txt | 208 +++++++--------- compiler/testData/psi/FunctionTypes_ERR.jet | 2 +- compiler/testData/psi/FunctionTypes_ERR.txt | 6 +- compiler/testData/psi/Functions.jet | 8 +- compiler/testData/psi/Functions.txt | 24 +- compiler/testData/psi/Imports.jet | 2 +- compiler/testData/psi/Imports.txt | 2 +- compiler/testData/psi/Imports_ERR.jet | 2 +- compiler/testData/psi/Imports_ERR.txt | 8 +- compiler/testData/psi/LocalDeclarations.jet | 2 +- compiler/testData/psi/LocalDeclarations.txt | 7 +- compiler/testData/psi/NamespaceBlock.jet | 12 +- compiler/testData/psi/NamespaceBlock.txt | 12 +- compiler/testData/psi/NamespaceBlockFirst.jet | 2 +- compiler/testData/psi/NamespaceBlockFirst.txt | 2 +- compiler/testData/psi/NamespaceBlock_ERR.jet | 16 +- compiler/testData/psi/NamespaceBlock_ERR.txt | 18 +- compiler/testData/psi/NamespaceModifiers.jet | 6 +- compiler/testData/psi/NamespaceModifiers.txt | 6 +- .../testData/psi/NewlinesInParentheses.jet | 14 +- .../testData/psi/NewlinesInParentheses.txt | 37 ++- compiler/testData/psi/Precedence.jet | 8 +- compiler/testData/psi/Precedence.txt | 40 ++-- compiler/testData/psi/RootNamespace.jet | 6 +- compiler/testData/psi/RootNamespace.txt | 11 +- compiler/testData/psi/ShortAnnotations.jet | 6 +- compiler/testData/psi/ShortAnnotations.txt | 6 +- compiler/testData/psi/SimpleExpressions.jet | 4 +- compiler/testData/psi/SimpleExpressions.txt | 2 + compiler/testData/psi/SimpleModifiers.jet | 2 +- compiler/testData/psi/SimpleModifiers.txt | 2 +- compiler/testData/psi/SoftKeywords.jet | 2 +- compiler/testData/psi/SoftKeywords.txt | 2 +- compiler/testData/psi/StringTemplates.jet | 4 +- compiler/testData/psi/StringTemplates.txt | 12 +- compiler/testData/psi/TupleTypes.jet | 16 +- compiler/testData/psi/TupleTypes.txt | 8 + compiler/testData/psi/TupleTypes_ERR.jet | 16 +- compiler/testData/psi/TupleTypes_ERR.txt | 8 + .../testData/psi/TuplesWithLabeledEntries.jet | 4 +- .../testData/psi/TuplesWithLabeledEntries.txt | 2 + compiler/testData/psi/TypeDef.jet | 2 +- compiler/testData/psi/TypeDef.txt | 2 +- .../psi/TypeExpressionAmbiguities_ERR.jet | 2 +- .../psi/TypeExpressionAmbiguities_ERR.txt | 3 + compiler/testData/psi/When.jet | 80 +++---- compiler/testData/psi/When.txt | 188 +++++++-------- compiler/testData/psi/When_ERR.jet | 28 +-- compiler/testData/psi/When_ERR.txt | 29 +-- compiler/testData/psi/examples/BinaryTree.jet | 32 +-- compiler/testData/psi/examples/BinaryTree.txt | 52 ++-- compiler/testData/psi/examples/Builder.jet | 2 +- compiler/testData/psi/examples/Builder.txt | 6 +- .../psi/examples/FunctionsAndTypes.jet | 30 +-- .../psi/examples/FunctionsAndTypes.txt | 93 +++----- compiler/testData/psi/examples/Graph.jet | 8 +- compiler/testData/psi/examples/Graph.txt | 20 +- compiler/testData/psi/examples/LINQ.jet | 2 +- compiler/testData/psi/examples/LINQ.txt | 2 +- .../psi/examples/PolymorphicClassObjects.jet | 2 +- .../psi/examples/PolymorphicClassObjects.txt | 6 +- compiler/testData/psi/examples/With.jet | 2 +- compiler/testData/psi/examples/With.txt | 6 +- .../testData/psi/examples/util/Comparison.jet | 6 +- .../testData/psi/examples/util/Comparison.txt | 14 +- 84 files changed, 797 insertions(+), 901 deletions(-) diff --git a/compiler/testData/psi/Attributes.jet b/compiler/testData/psi/Attributes.jet index 321691b72dc..2cf3b445414 100644 --- a/compiler/testData/psi/Attributes.jet +++ b/compiler/testData/psi/Attributes.jet @@ -1,4 +1,4 @@ -namespace foo.bar.goo +package foo.bar.goo abstract open diff --git a/compiler/testData/psi/Attributes.txt b/compiler/testData/psi/Attributes.txt index 6cb067b94eb..8119149e1b8 100644 --- a/compiler/testData/psi/Attributes.txt +++ b/compiler/testData/psi/Attributes.txt @@ -1,7 +1,7 @@ JetFile: Attributes.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/AttributesOnPatterns.jet b/compiler/testData/psi/AttributesOnPatterns.jet index ec9ead0312a..c485e7ca69a 100644 --- a/compiler/testData/psi/AttributesOnPatterns.jet +++ b/compiler/testData/psi/AttributesOnPatterns.jet @@ -1,11 +1,11 @@ fun foo() { when (e) { - is [a] val a => d - is [a] val a is foo => d - is [a] * => d - is [a] 2 => d - is [a] T => d - is [a] T @ () => d + is [a] val a -> d + is [a] val a is foo -> d + is [a] * -> d + is [a] 2 -> d + is [a] T -> d + is [a] T #() -> d } } diff --git a/compiler/testData/psi/AttributesOnPatterns.txt b/compiler/testData/psi/AttributesOnPatterns.txt index 545e0b1f3b1..c2b2d07c73c 100644 --- a/compiler/testData/psi/AttributesOnPatterns.txt +++ b/compiler/testData/psi/AttributesOnPatterns.txt @@ -43,7 +43,7 @@ JetFile: AttributesOnPatterns.jet PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('d') @@ -77,7 +77,7 @@ JetFile: AttributesOnPatterns.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('d') @@ -99,7 +99,7 @@ JetFile: AttributesOnPatterns.jet PsiWhiteSpace(' ') PsiElement(MUL)('*') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('d') @@ -122,7 +122,7 @@ JetFile: AttributesOnPatterns.jet INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('2') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('d') @@ -147,7 +147,7 @@ JetFile: AttributesOnPatterns.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('d') @@ -169,14 +169,13 @@ JetFile: AttributesOnPatterns.jet PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('d') diff --git a/compiler/testData/psi/Attributes_ERR.jet b/compiler/testData/psi/Attributes_ERR.jet index 03e73f7b999..7bc5aaa1e14 100644 --- a/compiler/testData/psi/Attributes_ERR.jet +++ b/compiler/testData/psi/Attributes_ERR.jet @@ -1,4 +1,4 @@ -namespace foo.bar.goo +package foo.bar.goo abstract open diff --git a/compiler/testData/psi/Attributes_ERR.txt b/compiler/testData/psi/Attributes_ERR.txt index 0f8116df665..9a1cb87e2ca 100644 --- a/compiler/testData/psi/Attributes_ERR.txt +++ b/compiler/testData/psi/Attributes_ERR.txt @@ -1,7 +1,7 @@ JetFile: Attributes_ERR.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/BabySteps.jet b/compiler/testData/psi/BabySteps.jet index a96fa43ff48..cf99c2a5705 100644 --- a/compiler/testData/psi/BabySteps.jet +++ b/compiler/testData/psi/BabySteps.jet @@ -1,4 +1,4 @@ -namespace foo +package foo class Runnable(a : doo = 0) : foo(d=0), bar by x, bar { diff --git a/compiler/testData/psi/BabySteps.txt b/compiler/testData/psi/BabySteps.txt index fbdf8deeafb..237827701cd 100644 --- a/compiler/testData/psi/BabySteps.txt +++ b/compiler/testData/psi/BabySteps.txt @@ -1,7 +1,7 @@ JetFile: BabySteps.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') PsiWhiteSpace('\n\n') diff --git a/compiler/testData/psi/BabySteps_ERR.jet b/compiler/testData/psi/BabySteps_ERR.jet index 97653321e3c..5648633c7f0 100644 --- a/compiler/testData/psi/BabySteps_ERR.jet +++ b/compiler/testData/psi/BabySteps_ERR.jet @@ -1,4 +1,4 @@ -namespace foo +package foo class Runnable(a : doo = 0) : foo(d=0), ,bar by x, bar { diff --git a/compiler/testData/psi/BabySteps_ERR.txt b/compiler/testData/psi/BabySteps_ERR.txt index 9f0a5ea788b..4838223fe42 100644 --- a/compiler/testData/psi/BabySteps_ERR.txt +++ b/compiler/testData/psi/BabySteps_ERR.txt @@ -1,7 +1,7 @@ JetFile: BabySteps_ERR.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') PsiWhiteSpace('\n\n') diff --git a/compiler/testData/psi/CallsInWhen.jet b/compiler/testData/psi/CallsInWhen.jet index 2675ba89523..4cacfb5fff4 100644 --- a/compiler/testData/psi/CallsInWhen.jet +++ b/compiler/testData/psi/CallsInWhen.jet @@ -1,14 +1,14 @@ fun foo() { when (a) { - a.foo => a - a.foo() => a - a.foo => a - a.foo(a) => a - a.foo(a, d) => a - a.{bar} => a - a.{!bar} => a - a.{() => !bar} => a - else => a + a.foo -> a + a.foo() -> a + a.foo -> a + a.foo(a) -> a + a.foo(a, d) -> a + a.{bar} -> a + a.{!bar} -> a + a.{() -> !bar} -> a + else -> a } } diff --git a/compiler/testData/psi/CallsInWhen.txt b/compiler/testData/psi/CallsInWhen.txt index 4bde9526e87..d67bce4cd23 100644 --- a/compiler/testData/psi/CallsInWhen.txt +++ b/compiler/testData/psi/CallsInWhen.txt @@ -33,7 +33,7 @@ JetFile: CallsInWhen.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -52,7 +52,7 @@ JetFile: CallsInWhen.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -76,7 +76,7 @@ JetFile: CallsInWhen.jet PsiElement(IDENTIFIER)('T') PsiElement(GT)('>') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -106,7 +106,7 @@ JetFile: CallsInWhen.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -141,7 +141,7 @@ JetFile: CallsInWhen.jet PsiElement(IDENTIFIER)('d') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -161,7 +161,7 @@ JetFile: CallsInWhen.jet PsiElement(IDENTIFIER)('bar') PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -184,7 +184,7 @@ JetFile: CallsInWhen.jet PsiElement(IDENTIFIER)('bar') PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -203,7 +203,7 @@ JetFile: CallsInWhen.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK PREFIX_EXPRESSION @@ -213,7 +213,7 @@ JetFile: CallsInWhen.jet PsiElement(IDENTIFIER)('bar') PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -221,7 +221,7 @@ JetFile: CallsInWhen.jet WHEN_ENTRY PsiElement(else)('else') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') diff --git a/compiler/testData/psi/FileStart_ERR.jet b/compiler/testData/psi/FileStart_ERR.jet index dafb2f44095..cbfc8a0477c 100644 --- a/compiler/testData/psi/FileStart_ERR.jet +++ b/compiler/testData/psi/FileStart_ERR.jet @@ -1,2 +1,2 @@ -/namespace foo.bar +/package foo.bar import foo \ No newline at end of file diff --git a/compiler/testData/psi/FileStart_ERR.txt b/compiler/testData/psi/FileStart_ERR.txt index 87894ee76dd..1f3f4e6a14a 100644 --- a/compiler/testData/psi/FileStart_ERR.txt +++ b/compiler/testData/psi/FileStart_ERR.txt @@ -6,7 +6,7 @@ JetFile: FileStart_ERR.jet PsiElement(DIV)('/') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/FunctionLiterals.jet b/compiler/testData/psi/FunctionLiterals.jet index 6fb663e9924..4c27813eefb 100644 --- a/compiler/testData/psi/FunctionLiterals.jet +++ b/compiler/testData/psi/FunctionLiterals.jet @@ -3,28 +3,28 @@ fun foo() { {foo} - {a => a} + {a -> a} - {(a) => a} - {(a : A) => a} - {(a : A) : T => a} - {(a) : T => 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) -> a} + {(a : A, a : B) -> a} + {(a : A, a) : T -> a} + {(a, a : B) : T -> a} - {() => a} - {() => a} - {() : T => a} - {() : T => a} + {() -> a} + {() -> a} + {() : T -> a} + {() : T -> a} - {T.(a) => a} - {T.(a : A) => a} - {T.(a : A) : T => 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} + {x, y -> 1} + {[a] x, [b] y, [c] z -> 1} } diff --git a/compiler/testData/psi/FunctionLiterals.txt b/compiler/testData/psi/FunctionLiterals.txt index 7bf48210b76..13fc16a5f1d 100644 --- a/compiler/testData/psi/FunctionLiterals.txt +++ b/compiler/testData/psi/FunctionLiterals.txt @@ -35,7 +35,7 @@ JetFile: FunctionLiterals.jet VALUE_PARAMETER PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -51,7 +51,7 @@ JetFile: FunctionLiterals.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -74,7 +74,7 @@ JetFile: FunctionLiterals.jet PsiElement(IDENTIFIER)('A') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -104,7 +104,7 @@ JetFile: FunctionLiterals.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -127,7 +127,7 @@ JetFile: FunctionLiterals.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -147,7 +147,7 @@ JetFile: FunctionLiterals.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -181,7 +181,7 @@ JetFile: FunctionLiterals.jet PsiElement(IDENTIFIER)('B') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -215,7 +215,7 @@ JetFile: FunctionLiterals.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -249,7 +249,7 @@ JetFile: FunctionLiterals.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -263,7 +263,7 @@ JetFile: FunctionLiterals.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -277,7 +277,7 @@ JetFile: FunctionLiterals.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -298,7 +298,7 @@ JetFile: FunctionLiterals.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -319,7 +319,7 @@ JetFile: FunctionLiterals.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -340,7 +340,7 @@ JetFile: FunctionLiterals.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -368,7 +368,7 @@ JetFile: FunctionLiterals.jet PsiElement(IDENTIFIER)('A') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -403,7 +403,7 @@ JetFile: FunctionLiterals.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -431,7 +431,7 @@ JetFile: FunctionLiterals.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -449,7 +449,7 @@ JetFile: FunctionLiterals.jet VALUE_PARAMETER PsiElement(IDENTIFIER)('y') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK INTEGER_CONSTANT @@ -459,56 +459,41 @@ JetFile: FunctionLiterals.jet FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - VALUE_PARAMETER - MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') + BLOCK + ANNOTATED_EXPRESSION + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('x') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiElement(RBRACKET)(']') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('x') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(LBRACKET)('[') + PsiElement(IDENTIFIER)('b') + PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('y') - PsiElement(COMMA)(',') - PsiWhiteSpace(' ') - VALUE_PARAMETER - MODIFIER_LIST - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('c') - PsiElement(RBRACKET)(']') + PsiElement(COMMA)(',') + PsiWhiteSpace(' ') + PsiElement(LBRACKET)('[') + PsiElement(IDENTIFIER)('c') + PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('z') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - BLOCK - INTEGER_CONSTANT + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') PsiElement(INTEGER_LITERAL)('1') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') \ No newline at end of file + PsiErrorElement:Expecting '} + \ No newline at end of file diff --git a/compiler/testData/psi/FunctionLiterals_ERR.jet b/compiler/testData/psi/FunctionLiterals_ERR.jet index e0fb54a1dc0..d275d6711a6 100644 --- a/compiler/testData/psi/FunctionLiterals_ERR.jet +++ b/compiler/testData/psi/FunctionLiterals_ERR.jet @@ -1,18 +1,18 @@ fun foo() { - { => a} + { -> a} - {(a => a} - {(a : ) => a} - {(a : A) : => a} - {(a) : T => } + {(a -> a} + {(a : ) -> a} + {(a : A) : -> a} + {(a) : T -> } - {(a, ) => a} - {(a : A, , a : B) => a} - {(a : A, , , a) : T => a} + {(a, ) -> a} + {(a : A, , a : B) -> a} + {(a : A, , , a) : T -> a} - {T.t(a) => a} - {T.t -(a : A) => a} + {T.t(a) -> a} + {T.t -(a : A) -> a} - {a : b => f} - {T.a : b => f} + {a : b -> f} + {T.a : b -> f} } \ No newline at end of file diff --git a/compiler/testData/psi/FunctionLiterals_ERR.txt b/compiler/testData/psi/FunctionLiterals_ERR.txt index 36f5a5db19b..922c8670737 100644 --- a/compiler/testData/psi/FunctionLiterals_ERR.txt +++ b/compiler/testData/psi/FunctionLiterals_ERR.txt @@ -17,12 +17,10 @@ JetFile: FunctionLiterals_ERR.jet FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - VALUE_PARAMETER - PsiErrorElement:Expecting parameter name - - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') + VALUE_PARAMETER_LIST + BLOCK REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -38,7 +36,7 @@ JetFile: FunctionLiterals_ERR.jet PsiErrorElement:Expecting ') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -60,7 +58,7 @@ JetFile: FunctionLiterals_ERR.jet PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -87,7 +85,7 @@ JetFile: FunctionLiterals_ERR.jet PsiErrorElement:Expecting a type PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -110,7 +108,7 @@ JetFile: FunctionLiterals_ERR.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK @@ -129,7 +127,7 @@ JetFile: FunctionLiterals_ERR.jet PsiWhiteSpace(' ') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -166,7 +164,7 @@ JetFile: FunctionLiterals_ERR.jet PsiElement(IDENTIFIER)('B') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -208,7 +206,7 @@ JetFile: FunctionLiterals_ERR.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK REFERENCE_EXPRESSION @@ -218,100 +216,118 @@ JetFile: FunctionLiterals_ERR.jet FUNCTION_LITERAL_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE + BLOCK + DOT_QUALIFIED_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - PsiErrorElement:Expecting '(' - PsiElement(IDENTIFIER)('t') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - PsiErrorElement:Expecting '(' - PsiElement(IDENTIFIER)('t') + PsiElement(DOT)('.') + CALL_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + VALUE_ARGUMENT_LIST + PsiElement(LPAR)('(') + VALUE_ARGUMENT + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(MINUS)('-') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('A') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - VALUE_PARAMETER_LIST - VALUE_PARAMETER - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiErrorElement:To specify a type of a parameter or a return type, use the full notation: {(parameter : Type) : ReturnType => ...} - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - VALUE_PARAMETER - PsiErrorElement:Expecting parameter name - - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('f') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION - FUNCTION_LITERAL - PsiElement(LBRACE)('{') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiElement(DOT)('.') - PsiErrorElement:To specify a receiver type, use the full notation: {ReceiverType.(parameters) [: ReturnType] => ...} - PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') - PsiWhiteSpace(' ') - BLOCK - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('f') - PsiElement(RBRACE)('}') - PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') \ No newline at end of file + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + BLOCK + BINARY_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('t') + PsiWhiteSpace(' ') + OPERATION_REFERENCE + 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)(')') + 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)('{') + VALUE_PARAMETER_LIST + VALUE_PARAMETER + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + PsiErrorElement:To specify a type of a parameter or a return type, use the full notation: {(parameter : Type) : ReturnType => ...} + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiErrorElement:Expecting parameter name + + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('f') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n ') + FUNCTION_LITERAL_EXPRESSION + FUNCTION_LITERAL + PsiElement(LBRACE)('{') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiErrorElement:Expecting a parameter list in parentheses (...) + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + VALUE_PARAMETER + PsiErrorElement:Expecting parameter declaration + + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiErrorElement:Expecting ') + + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + BLOCK + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('f') + PsiElement(RBRACE)('}') + PsiWhiteSpace('\n') + PsiElement(RBRACE)('}') + PsiErrorElement:Expecting '}' + \ No newline at end of file diff --git a/compiler/testData/psi/FunctionTypes.jet b/compiler/testData/psi/FunctionTypes.jet index 4187222c8e0..0e94be440f8 100644 --- a/compiler/testData/psi/FunctionTypes.jet +++ b/compiler/testData/psi/FunctionTypes.jet @@ -1,24 +1,24 @@ -type f = fun ([a] a) : b -type f = fun (a) : b -type f = fun () : [x] b -type f = fun () : () +type f = ([a] a) -> b +type f = (a) -> b +type f = () -> [x] b +type f = () -> #() -type f = fun (a : [a] a) : b -type f = fun (a : a) : b -type f = fun () : b -type f = fun () : () +type f = (a : [a] a) -> b +type f = (a : a) -> b +type f = () -> b +type f = () -> #() -type f = fun (a : [a] a, foo, x : bar) : b -type f = fun (foo, a : a) : b -type f = fun (foo, a : fun (a) : b) : b -type f = fun (foo, a : fun (a) : b) : fun () : () +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 = fun (ref foo, ref a : fun (ref a) : b) : fun () : () +type f = (ref foo, ref a : (ref a) -> b) -> () -> #() -type f = fun T.() : () -type f = fun T.T.() : () -type f = fun T.T.() : () +type f = T.() -> #() +type f = T.T.() -> #() +type f = T.T.() -> #() -type f = [a] fun T.() : () -type f = [a] fun T.T.() : () -type f = [a] fun T.T.() : () +type f = [a] T.() -> #() +type f = [a] T.T.() -> #() +type f = [a] T.T.() -> #() diff --git a/compiler/testData/psi/FunctionTypes.txt b/compiler/testData/psi/FunctionTypes.txt index 47e8aa32ae6..3442c373210 100644 --- a/compiler/testData/psi/FunctionTypes.txt +++ b/compiler/testData/psi/FunctionTypes.txt @@ -10,11 +10,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -35,7 +33,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -50,11 +48,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -64,7 +60,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -79,16 +75,14 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE ANNOTATION @@ -113,19 +107,18 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') @@ -137,11 +130,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -165,7 +156,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -180,11 +171,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -198,7 +187,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -213,16 +202,14 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -237,19 +224,18 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') @@ -261,11 +247,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -307,7 +291,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('bar') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -322,11 +306,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -347,7 +329,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -362,11 +344,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -380,11 +360,9 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -394,7 +372,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -402,7 +380,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -417,11 +395,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -435,11 +411,9 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -449,7 +423,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -457,20 +431,19 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') @@ -482,11 +455,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -506,11 +477,9 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -523,7 +492,7 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -531,20 +500,19 @@ JetFile: FunctionTypes.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') @@ -556,11 +524,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -570,10 +536,11 @@ JetFile: FunctionTypes.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n') @@ -585,11 +552,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE USER_TYPE @@ -603,10 +568,11 @@ JetFile: FunctionTypes.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n') @@ -618,11 +584,9 @@ JetFile: FunctionTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE USER_TYPE @@ -659,10 +623,11 @@ JetFile: FunctionTypes.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') @@ -676,20 +641,18 @@ JetFile: FunctionTypes.jet PsiElement(EQ)('=') PsiWhiteSpace(' ') TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') @@ -698,10 +661,11 @@ JetFile: FunctionTypes.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n') @@ -715,20 +679,18 @@ JetFile: FunctionTypes.jet PsiElement(EQ)('=') PsiWhiteSpace(' ') TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') USER_TYPE USER_TYPE REFERENCE_EXPRESSION @@ -741,10 +703,11 @@ JetFile: FunctionTypes.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n') @@ -758,20 +721,18 @@ JetFile: FunctionTypes.jet PsiElement(EQ)('=') PsiWhiteSpace(' ') TYPE_REFERENCE - ANNOTATION - PsiElement(LBRACKET)('[') - ANNOTATION_ENTRY - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('a') - PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') TYPE_REFERENCE + ANNOTATION + PsiElement(LBRACKET)('[') + ANNOTATION_ENTRY + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RBRACKET)(']') + PsiWhiteSpace(' ') USER_TYPE USER_TYPE REFERENCE_EXPRESSION @@ -807,9 +768,10 @@ JetFile: FunctionTypes.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') \ No newline at end of file diff --git a/compiler/testData/psi/FunctionTypes_ERR.jet b/compiler/testData/psi/FunctionTypes_ERR.jet index 204ee20a422..f948522e84e 100644 --- a/compiler/testData/psi/FunctionTypes_ERR.jet +++ b/compiler/testData/psi/FunctionTypes_ERR.jet @@ -1 +1 @@ -type f = fun (a, ) : b +type f = (a, ) -> b diff --git a/compiler/testData/psi/FunctionTypes_ERR.txt b/compiler/testData/psi/FunctionTypes_ERR.txt index 80d5db63e38..d3201689668 100644 --- a/compiler/testData/psi/FunctionTypes_ERR.txt +++ b/compiler/testData/psi/FunctionTypes_ERR.txt @@ -10,11 +10,9 @@ JetFile: FunctionTypes_ERR.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -28,7 +26,7 @@ JetFile: FunctionTypes_ERR.jet PsiWhiteSpace(' ') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/Functions.jet b/compiler/testData/psi/Functions.jet index bc7ed706c1d..86bb4dbce06 100644 --- a/compiler/testData/psi/Functions.jet +++ b/compiler/testData/psi/Functions.jet @@ -2,21 +2,21 @@ fun foo() fun [a] foo() fun [a] T.foo() fun [a] T.foo(a : foo) : bar -fun [a()] T.foo(a : foo) : bar +fun [a()] T.foo b>(a : foo) : bar fun foo(); fun [a] foo(); fun [a] T.foo(); fun [a] T.foo(a : foo) : bar; -fun [a()] T.foo(a : foo) : bar; +fun [a()] T.foo b>(a : foo) : bar; fun foo() {} fun [a] foo() {} fun [a] T.foo() {} fun [a] T.foo(a : foo) : bar {} -fun [a()] T.foo(a : foo) : bar {} +fun [a()] T.foo b>(a : foo) : bar {} -fun [a()] T.foo(a : foo) : bar {} +fun [a()] T.foo b>(a : foo) : bar {} fun A?.foo() : bar? fun A? .foo() : bar? \ No newline at end of file diff --git a/compiler/testData/psi/Functions.txt b/compiler/testData/psi/Functions.txt index 9626affdd1a..03ea683c1af 100644 --- a/compiler/testData/psi/Functions.txt +++ b/compiler/testData/psi/Functions.txt @@ -118,11 +118,9 @@ JetFile: Functions.jet PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -132,7 +130,7 @@ JetFile: Functions.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -279,11 +277,9 @@ JetFile: Functions.jet PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -293,7 +289,7 @@ JetFile: Functions.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -453,11 +449,9 @@ JetFile: Functions.jet PsiElement(IDENTIFIER)('T') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -467,7 +461,7 @@ JetFile: Functions.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -537,10 +531,8 @@ JetFile: Functions.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiElement(RBRACKET)(']') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -550,7 +542,7 @@ JetFile: Functions.jet PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/Imports.jet b/compiler/testData/psi/Imports.jet index 6230669c2ae..c678ba5dd7f 100644 --- a/compiler/testData/psi/Imports.jet +++ b/compiler/testData/psi/Imports.jet @@ -1,4 +1,4 @@ -namespace foo.bar.goo +package foo.bar.goo import namespace.foo import foo diff --git a/compiler/testData/psi/Imports.txt b/compiler/testData/psi/Imports.txt index b80711ff1a2..2d274dd3bd7 100644 --- a/compiler/testData/psi/Imports.txt +++ b/compiler/testData/psi/Imports.txt @@ -1,7 +1,7 @@ JetFile: Imports.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/Imports_ERR.jet b/compiler/testData/psi/Imports_ERR.jet index 3d27c2cefdf..fc8120528c7 100644 --- a/compiler/testData/psi/Imports_ERR.jet +++ b/compiler/testData/psi/Imports_ERR.jet @@ -1,4 +1,4 @@ -namespace foo.bar.goo +package foo.bar.goo import namespace ; import namespace.* diff --git a/compiler/testData/psi/Imports_ERR.txt b/compiler/testData/psi/Imports_ERR.txt index 7e96a0f9b6a..71c49ec4414 100644 --- a/compiler/testData/psi/Imports_ERR.txt +++ b/compiler/testData/psi/Imports_ERR.txt @@ -1,7 +1,7 @@ JetFile: Imports_ERR.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -94,7 +94,7 @@ JetFile: Imports_ERR.jet PsiElement(DOT)('.') PsiWhiteSpace(' ') REFERENCE_EXPRESSION - PsiErrorElement:Type name expected + PsiErrorElement:Expecting type name PsiElement(as)('as') PsiWhiteSpace(' ') ANNOTATION_ENTRY @@ -124,7 +124,7 @@ JetFile: Imports_ERR.jet PsiElement(IDENTIFIER)('bar') PsiElement(DOT)('.') REFERENCE_EXPRESSION - PsiErrorElement:Type name expected + PsiErrorElement:Expecting type name PsiElement(MUL)('*') PsiWhiteSpace(' ') PsiErrorElement:Expecting namespace or top level declaration @@ -158,7 +158,7 @@ JetFile: Imports_ERR.jet PsiElement(IDENTIFIER)('bar') PsiElement(DOT)('.') REFERENCE_EXPRESSION - PsiErrorElement:Type name expected + PsiErrorElement:Expecting type name PsiElement(MUL)('*') PsiWhiteSpace(' ') PsiErrorElement:Expecting namespace or top level declaration diff --git a/compiler/testData/psi/LocalDeclarations.jet b/compiler/testData/psi/LocalDeclarations.jet index abe0308a864..4254634f0e5 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 = fun T.() : () + type f = T.() -> #() } diff --git a/compiler/testData/psi/LocalDeclarations.txt b/compiler/testData/psi/LocalDeclarations.txt index d9a4c472683..4c9090fd03a 100644 --- a/compiler/testData/psi/LocalDeclarations.txt +++ b/compiler/testData/psi/LocalDeclarations.txt @@ -109,11 +109,9 @@ JetFile: LocalDeclarations.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -123,10 +121,11 @@ JetFile: LocalDeclarations.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n\n') diff --git a/compiler/testData/psi/NamespaceBlock.jet b/compiler/testData/psi/NamespaceBlock.jet index 10b13428cd4..cf3ba05fd99 100644 --- a/compiler/testData/psi/NamespaceBlock.jet +++ b/compiler/testData/psi/NamespaceBlock.jet @@ -1,16 +1,16 @@ -namespace foo.bar.goo +package foo.bar.goo import foo as bar -namespace foof { +package foof { import foo.bar.*; class Foo {} - namespace bar { + package bar { class Bar {} - namespace ns { + package ns { class X class Y @@ -21,9 +21,9 @@ namespace foof { class Bar {} -namespace foo {} +package foo {} -namespace bar { +package bar { import sdf } \ No newline at end of file diff --git a/compiler/testData/psi/NamespaceBlock.txt b/compiler/testData/psi/NamespaceBlock.txt index 1d32e0b59c6..33b0d00d72a 100644 --- a/compiler/testData/psi/NamespaceBlock.txt +++ b/compiler/testData/psi/NamespaceBlock.txt @@ -1,7 +1,7 @@ JetFile: NamespaceBlock.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -23,7 +23,7 @@ JetFile: NamespaceBlock.jet PsiWhiteSpace('\n\n') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foof') PsiWhiteSpace(' ') @@ -56,7 +56,7 @@ JetFile: NamespaceBlock.jet PsiWhiteSpace('\n\n ') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') @@ -76,7 +76,7 @@ JetFile: NamespaceBlock.jet PsiWhiteSpace('\n\n ') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('ns') PsiWhiteSpace(' ') @@ -119,7 +119,7 @@ JetFile: NamespaceBlock.jet PsiWhiteSpace('\n\n') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') PsiWhiteSpace(' ') @@ -130,7 +130,7 @@ JetFile: NamespaceBlock.jet PsiWhiteSpace('\n\n') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/NamespaceBlockFirst.jet b/compiler/testData/psi/NamespaceBlockFirst.jet index d3324536a1a..22ec2b0ed6b 100644 --- a/compiler/testData/psi/NamespaceBlockFirst.jet +++ b/compiler/testData/psi/NamespaceBlockFirst.jet @@ -1,4 +1,4 @@ -namespace foobar { +package foobar { val a = 1 val b = foobar.a } diff --git a/compiler/testData/psi/NamespaceBlockFirst.txt b/compiler/testData/psi/NamespaceBlockFirst.txt index daf5656d2ab..fcb33b0afae 100644 --- a/compiler/testData/psi/NamespaceBlockFirst.txt +++ b/compiler/testData/psi/NamespaceBlockFirst.txt @@ -4,7 +4,7 @@ JetFile: NamespaceBlockFirst.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foobar') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/NamespaceBlock_ERR.jet b/compiler/testData/psi/NamespaceBlock_ERR.jet index 66bf0b8d58f..a22d5edaa88 100644 --- a/compiler/testData/psi/NamespaceBlock_ERR.jet +++ b/compiler/testData/psi/NamespaceBlock_ERR.jet @@ -1,11 +1,11 @@ -namespace foo.bar.goo +package foo.bar.goo import foo as import foo. import foo.bar. import foo. as bar -namespace foof { +package foof { import foo.bar.* as bar import foo as ; import foo. ; @@ -14,13 +14,13 @@ namespace foof { import foo.bar.* as bar ; import foo.bar.* as ; - namespace foo + package foo class Foo {} - namespace { + package { class Bar {} - namespace ns { + package ns { class X class Y @@ -32,11 +32,11 @@ dsfgd class Bar {} -namespace foo +package foo -namespace {} +package {} -namespace bar { +package bar { import sdf } \ No newline at end of file diff --git a/compiler/testData/psi/NamespaceBlock_ERR.txt b/compiler/testData/psi/NamespaceBlock_ERR.txt index 1675b5bb0bc..8d418eb0f6c 100644 --- a/compiler/testData/psi/NamespaceBlock_ERR.txt +++ b/compiler/testData/psi/NamespaceBlock_ERR.txt @@ -1,7 +1,7 @@ JetFile: NamespaceBlock_ERR.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -61,7 +61,7 @@ JetFile: NamespaceBlock_ERR.jet PsiElement(DOT)('.') PsiWhiteSpace(' ') REFERENCE_EXPRESSION - PsiErrorElement:Type name expected + PsiErrorElement:Expecting type name PsiElement(as)('as') PsiWhiteSpace(' ') ANNOTATION_ENTRY @@ -72,7 +72,7 @@ JetFile: NamespaceBlock_ERR.jet PsiElement(IDENTIFIER)('bar') PsiWhiteSpace('\n\n') NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foof') PsiWhiteSpace(' ') @@ -193,7 +193,7 @@ JetFile: NamespaceBlock_ERR.jet PsiWhiteSpace('\n\n ') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') PsiErrorElement:A namespace block in '{...}' expected @@ -212,7 +212,7 @@ JetFile: NamespaceBlock_ERR.jet PsiWhiteSpace('\n ') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiErrorElement:Expecting namespace name PsiWhiteSpace(' ') @@ -232,7 +232,7 @@ JetFile: NamespaceBlock_ERR.jet PsiWhiteSpace('\n\n ') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('ns') PsiWhiteSpace(' ') @@ -283,7 +283,7 @@ JetFile: NamespaceBlock_ERR.jet PsiWhiteSpace('\n\n') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('foo') PsiErrorElement:A namespace block in '{...}' expected @@ -291,7 +291,7 @@ JetFile: NamespaceBlock_ERR.jet PsiWhiteSpace('\n\n') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiErrorElement:Expecting namespace name PsiWhiteSpace(' ') @@ -302,7 +302,7 @@ JetFile: NamespaceBlock_ERR.jet PsiWhiteSpace('\n\n') NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/NamespaceModifiers.jet b/compiler/testData/psi/NamespaceModifiers.jet index c842220ebe8..de65a560b82 100644 --- a/compiler/testData/psi/NamespaceModifiers.jet +++ b/compiler/testData/psi/NamespaceModifiers.jet @@ -1,9 +1,9 @@ -public [a] namespace name; +public [a] package name; -[a] namespace a { +[a] package a { val foo - private namespace b { + private package b { } } \ No newline at end of file diff --git a/compiler/testData/psi/NamespaceModifiers.txt b/compiler/testData/psi/NamespaceModifiers.txt index 6dc1a3459f4..67db2bc7e0c 100644 --- a/compiler/testData/psi/NamespaceModifiers.txt +++ b/compiler/testData/psi/NamespaceModifiers.txt @@ -14,7 +14,7 @@ JetFile: NamespaceModifiers.jet PsiElement(IDENTIFIER)('a') PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('name') PsiElement(SEMICOLON)(';') @@ -32,7 +32,7 @@ JetFile: NamespaceModifiers.jet PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') @@ -49,7 +49,7 @@ JetFile: NamespaceModifiers.jet PsiElement(private)('private') PsiWhiteSpace(' ') NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('b') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/NewlinesInParentheses.jet b/compiler/testData/psi/NewlinesInParentheses.jet index 8feebf2ea52..277f48e644a 100644 --- a/compiler/testData/psi/NewlinesInParentheses.jet +++ b/compiler/testData/psi/NewlinesInParentheses.jet @@ -21,17 +21,17 @@ fun foo() { + d] when (e) { - is T @ - () => a + is T + #() -> a in f - () => a + () -> a !is T - @ () => a + #() -> a !in f - () => a + () -> a f - () => a + () -> a } val f = a is T - () + #() } \ No newline at end of file diff --git a/compiler/testData/psi/NewlinesInParentheses.txt b/compiler/testData/psi/NewlinesInParentheses.txt index 95f9c053518..10b4cde8cd4 100644 --- a/compiler/testData/psi/NewlinesInParentheses.txt +++ b/compiler/testData/psi/NewlinesInParentheses.txt @@ -244,14 +244,13 @@ JetFile: NewlinesInParentheses.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace('\n ') + PsiWhiteSpace(' \n ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -269,7 +268,7 @@ JetFile: NewlinesInParentheses.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -281,14 +280,13 @@ JetFile: NewlinesInParentheses.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('T') - PsiWhiteSpace('\n ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace('\n ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -306,7 +304,7 @@ JetFile: NewlinesInParentheses.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -322,7 +320,7 @@ JetFile: NewlinesInParentheses.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') @@ -343,14 +341,13 @@ JetFile: NewlinesInParentheses.jet OPERATION_REFERENCE PsiElement(is)('is') PsiWhiteSpace(' ') - TYPE_PATTERN - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('T') - PsiWhiteSpace('\n ') - TUPLE - PsiElement(LPAR)('(') - PsiElement(RPAR)(')') + DECOMPOSER_PATTERN + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('T') + PsiWhiteSpace('\n ') + DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') PsiWhiteSpace('\n') PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/psi/Precedence.jet b/compiler/testData/psi/Precedence.jet index 3970cea3476..70a5fcc23cf 100644 --- a/compiler/testData/psi/Precedence.jet +++ b/compiler/testData/psi/Precedence.jet @@ -37,19 +37,19 @@ fun foo() { t : Any? t as Any? t as Any.Any.Any - t as fun () : T + t as () -> T t as? Any? t as? Any.Any.Any - t as? fun () : T + t as? () -> T t : Any * 1 t : Any? * 1 t as Any? * 1 t as Any.Any.Any * 1 - t as fun () : T * 1 + t as () -> T * 1 t as? Any? * 1 t as? Any.Any.Any * 1 - t as? fun () : T * 1 + t as? () -> T * 1 ++t : Any + 1 a.b : Any + 1 diff --git a/compiler/testData/psi/Precedence.txt b/compiler/testData/psi/Precedence.txt index 5ba29479d36..0fee3e39d4e 100644 --- a/compiler/testData/psi/Precedence.txt +++ b/compiler/testData/psi/Precedence.txt @@ -671,15 +671,13 @@ JetFile: Precedence.jet OPERATION_REFERENCE PsiElement(EQ)('=') PsiWhiteSpace(' ') - BINARY_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('b') - PsiWhiteSpace(' ') - OPERATION_REFERENCE - PsiElement(ARROW)('->') - PsiWhiteSpace(' ') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('c') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('b') + PsiWhiteSpace(' ') + PsiErrorElement:Unexpected tokens (use ';' to separate expressions on the same line) + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('c') PsiWhiteSpace('\n ') BINARY_EXPRESSION REFERENCE_EXPRESSION @@ -788,16 +786,14 @@ JetFile: Precedence.jet PsiWhiteSpace(' ') OPERATION_REFERENCE PsiElement(as)('as') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -868,16 +864,14 @@ JetFile: Precedence.jet PsiWhiteSpace(' ') OPERATION_REFERENCE PsiElement(AS_SAFE)('as?') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -1003,16 +997,14 @@ JetFile: Precedence.jet PsiWhiteSpace(' ') OPERATION_REFERENCE PsiElement(as)('as') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -1104,16 +1096,14 @@ JetFile: Precedence.jet PsiWhiteSpace(' ') OPERATION_REFERENCE PsiElement(AS_SAFE)('as?') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/RootNamespace.jet b/compiler/testData/psi/RootNamespace.jet index cc0a53278e2..153991eea55 100644 --- a/compiler/testData/psi/RootNamespace.jet +++ b/compiler/testData/psi/RootNamespace.jet @@ -1,13 +1,13 @@ -namespace foo.bar; +package foo.bar; class X -namespace foo.bar { +package foo.bar { fun foo() { namespace.foo.bar.X namespace.foo.bar.X() when (e) { - is namespace.foo.bar.X @ (x) => {} + is namespace.foo.bar.X #(x) -> {} } } } \ No newline at end of file diff --git a/compiler/testData/psi/RootNamespace.txt b/compiler/testData/psi/RootNamespace.txt index 33f37629a7f..c5af1609b1e 100644 --- a/compiler/testData/psi/RootNamespace.txt +++ b/compiler/testData/psi/RootNamespace.txt @@ -1,7 +1,7 @@ JetFile: RootNamespace.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -18,7 +18,7 @@ JetFile: RootNamespace.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -102,10 +102,9 @@ JetFile: RootNamespace.jet PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('X') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -115,7 +114,7 @@ JetFile: RootNamespace.jet PsiElement(IDENTIFIER)('x') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/ShortAnnotations.jet b/compiler/testData/psi/ShortAnnotations.jet index b05a2c3863c..e6137d0a754 100644 --- a/compiler/testData/psi/ShortAnnotations.jet +++ b/compiler/testData/psi/ShortAnnotations.jet @@ -1,6 +1,6 @@ -foo bar(1) buzz(1) zoo namespace aa +foo bar(1) buzz(1) zoo package aa -foo bar(1) buzz(1) zoo namespace a {} +foo bar(1) buzz(1) zoo package a {} foo bar(1) buzz(1) zoo class A foo bar(1) buzz(1) zoo object B foo bar(1) buzz(1) zoo fun a() {} @@ -24,6 +24,6 @@ class Foo { fun test() { when (foo bar(1) buzz(1) zoo val a = 1) { - 1 => 1 + 1 -> 1 } } \ No newline at end of file diff --git a/compiler/testData/psi/ShortAnnotations.txt b/compiler/testData/psi/ShortAnnotations.txt index cc795b1920f..a559bce1ddd 100644 --- a/compiler/testData/psi/ShortAnnotations.txt +++ b/compiler/testData/psi/ShortAnnotations.txt @@ -50,7 +50,7 @@ JetFile: ShortAnnotations.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('zoo') PsiWhiteSpace(' ') - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('aa') PsiWhiteSpace('\n\n') @@ -105,7 +105,7 @@ JetFile: ShortAnnotations.jet PsiElement(IDENTIFIER)('zoo') PsiWhiteSpace(' ') NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') @@ -1134,7 +1134,7 @@ JetFile: ShortAnnotations.jet INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') diff --git a/compiler/testData/psi/SimpleExpressions.jet b/compiler/testData/psi/SimpleExpressions.jet index a3969d2b230..4e931bb6945 100644 --- a/compiler/testData/psi/SimpleExpressions.jet +++ b/compiler/testData/psi/SimpleExpressions.jet @@ -1,6 +1,6 @@ fun a( - a : foo = (), + a : foo = #(), a : foo = 10, a : foo = 0x10, a : foo = '1', @@ -17,7 +17,7 @@ fun a( a : foo = this, a : foo = super, a : foo = (10), - a : foo = (10, "A", 0xf), + a : foo = #(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 45ce1f23b2f..195e3389052 100644 --- a/compiler/testData/psi/SimpleExpressions.txt +++ b/compiler/testData/psi/SimpleExpressions.txt @@ -22,6 +22,7 @@ JetFile: SimpleExpressions.jet PsiElement(EQ)('=') PsiWhiteSpace(' ') TUPLE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiElement(COMMA)(',') @@ -325,6 +326,7 @@ JetFile: SimpleExpressions.jet PsiElement(EQ)('=') PsiWhiteSpace(' ') TUPLE + PsiElement(HASH)('#') PsiElement(LPAR)('(') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('10') diff --git a/compiler/testData/psi/SimpleModifiers.jet b/compiler/testData/psi/SimpleModifiers.jet index 407ad761e34..ac9d1dbc7b9 100644 --- a/compiler/testData/psi/SimpleModifiers.jet +++ b/compiler/testData/psi/SimpleModifiers.jet @@ -1,4 +1,4 @@ -namespace foo.bar.goo +package foo.bar.goo abstract open diff --git a/compiler/testData/psi/SimpleModifiers.txt b/compiler/testData/psi/SimpleModifiers.txt index 4df3f2f9c98..a4c58c3241e 100644 --- a/compiler/testData/psi/SimpleModifiers.txt +++ b/compiler/testData/psi/SimpleModifiers.txt @@ -1,7 +1,7 @@ JetFile: SimpleModifiers.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/SoftKeywords.jet b/compiler/testData/psi/SoftKeywords.jet index 829934a583a..b2ebd5d865e 100644 --- a/compiler/testData/psi/SoftKeywords.jet +++ b/compiler/testData/psi/SoftKeywords.jet @@ -1,4 +1,4 @@ -namespace foo.bar.goo +package foo.bar.goo import foo diff --git a/compiler/testData/psi/SoftKeywords.txt b/compiler/testData/psi/SoftKeywords.txt index 01fccd725d8..dcfafc412d1 100644 --- a/compiler/testData/psi/SoftKeywords.txt +++ b/compiler/testData/psi/SoftKeywords.txt @@ -1,7 +1,7 @@ JetFile: SoftKeywords.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/StringTemplates.jet b/compiler/testData/psi/StringTemplates.jet index 8bdec253be9..70723ad6f38 100644 --- a/compiler/testData/psi/StringTemplates.jet +++ b/compiler/testData/psi/StringTemplates.jet @@ -3,8 +3,8 @@ fun demo() { val a = "" val asd = 1 val bar = 5 - fun map(f : fun () : Any?) : Int = 1 - fun buzz(f : fun () : Any?) : Int = 1 + fun map(f : () -> Any?) : Int = 1 + fun buzz(f : () -> Any?) : Int = 1 val sdf = 1 val foo = 3; "$this must be$as$t" diff --git a/compiler/testData/psi/StringTemplates.txt b/compiler/testData/psi/StringTemplates.txt index 07ea659f400..f7aac5bf538 100644 --- a/compiler/testData/psi/StringTemplates.txt +++ b/compiler/testData/psi/StringTemplates.txt @@ -64,16 +64,14 @@ JetFile: StringTemplates.jet PsiElement(IDENTIFIER)('f') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE NULLABLE_TYPE @@ -105,16 +103,14 @@ JetFile: StringTemplates.jet PsiElement(IDENTIFIER)('f') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE NULLABLE_TYPE diff --git a/compiler/testData/psi/TupleTypes.jet b/compiler/testData/psi/TupleTypes.jet index 98047a6d660..930344a9c8f 100644 --- a/compiler/testData/psi/TupleTypes.jet +++ b/compiler/testData/psi/TupleTypes.jet @@ -1,10 +1,10 @@ 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) + 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 index cb44ded1528..d13da2370ce 100644 --- a/compiler/testData/psi/TupleTypes.txt +++ b/compiler/testData/psi/TupleTypes.txt @@ -18,6 +18,7 @@ JetFile: TupleTypes.jet PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiElement(COMMA)(',') @@ -29,6 +30,7 @@ JetFile: TupleTypes.jet PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE USER_TYPE @@ -44,6 +46,7 @@ JetFile: TupleTypes.jet PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE USER_TYPE @@ -65,6 +68,7 @@ JetFile: TupleTypes.jet PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') LABELED_TUPLE_TYPE_ENTRY PsiElement(IDENTIFIER)('x') @@ -106,6 +110,7 @@ JetFile: TupleTypes.jet PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiElement(COMMA)(',') @@ -126,6 +131,7 @@ JetFile: TupleTypes.jet PsiElement(IDENTIFIER)('x') PsiElement(RBRACKET)(']') TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE ANNOTATION @@ -161,6 +167,7 @@ JetFile: TupleTypes.jet PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE ANNOTATION @@ -211,6 +218,7 @@ JetFile: TupleTypes.jet PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') LABELED_TUPLE_TYPE_ENTRY PsiElement(IDENTIFIER)('x') diff --git a/compiler/testData/psi/TupleTypes_ERR.jet b/compiler/testData/psi/TupleTypes_ERR.jet index 75924194f84..c4e70baf21f 100644 --- a/compiler/testData/psi/TupleTypes_ERR.jet +++ b/compiler/testData/psi/TupleTypes_ERR.jet @@ -1,10 +1,10 @@ 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) + 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 index 5b984020566..3109fe1efef 100644 --- a/compiler/testData/psi/TupleTypes_ERR.txt +++ b/compiler/testData/psi/TupleTypes_ERR.txt @@ -18,6 +18,7 @@ JetFile: TupleTypes_ERR.jet PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiElement(COMMA)(',') @@ -29,6 +30,7 @@ JetFile: TupleTypes_ERR.jet PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE USER_TYPE @@ -44,6 +46,7 @@ JetFile: TupleTypes_ERR.jet PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE USER_TYPE @@ -63,6 +66,7 @@ JetFile: TupleTypes_ERR.jet PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') LABELED_TUPLE_TYPE_ENTRY PsiElement(IDENTIFIER)('x') @@ -101,6 +105,7 @@ JetFile: TupleTypes_ERR.jet PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiElement(COMMA)(',') @@ -121,6 +126,7 @@ JetFile: TupleTypes_ERR.jet PsiElement(IDENTIFIER)('x') PsiElement(RBRACKET)(']') TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE ANNOTATION @@ -160,6 +166,7 @@ JetFile: TupleTypes_ERR.jet PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE ANNOTATION @@ -210,6 +217,7 @@ JetFile: TupleTypes_ERR.jet PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') LABELED_TUPLE_TYPE_ENTRY PsiElement(IDENTIFIER)('x') diff --git a/compiler/testData/psi/TuplesWithLabeledEntries.jet b/compiler/testData/psi/TuplesWithLabeledEntries.jet index 8e1ee98d58a..c03fa82a256 100644 --- a/compiler/testData/psi/TuplesWithLabeledEntries.jet +++ b/compiler/testData/psi/TuplesWithLabeledEntries.jet @@ -1,2 +1,2 @@ -val foo = (a = 3) -val foo = (a = 3, a) \ No newline at end of file +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 index bb38c8417a9..0b775f17659 100644 --- a/compiler/testData/psi/TuplesWithLabeledEntries.txt +++ b/compiler/testData/psi/TuplesWithLabeledEntries.txt @@ -10,6 +10,7 @@ JetFile: TuplesWithLabeledEntries.jet PsiElement(EQ)('=') PsiWhiteSpace(' ') TUPLE + PsiElement(HASH)('#') PsiElement(LPAR)('(') LABELED_TUPLE_ENTRY PsiElement(IDENTIFIER)('a') @@ -28,6 +29,7 @@ JetFile: TuplesWithLabeledEntries.jet PsiElement(EQ)('=') PsiWhiteSpace(' ') TUPLE + PsiElement(HASH)('#') PsiElement(LPAR)('(') LABELED_TUPLE_ENTRY PsiElement(IDENTIFIER)('a') diff --git a/compiler/testData/psi/TypeDef.jet b/compiler/testData/psi/TypeDef.jet index 9aab7e0e4a7..12365eae7e7 100644 --- a/compiler/testData/psi/TypeDef.jet +++ b/compiler/testData/psi/TypeDef.jet @@ -1,4 +1,4 @@ -namespace foo.bar.goo +package foo.bar.goo type foo = bar type foo = bar diff --git a/compiler/testData/psi/TypeDef.txt b/compiler/testData/psi/TypeDef.txt index f55ffb3a657..ac161f21cf6 100644 --- a/compiler/testData/psi/TypeDef.txt +++ b/compiler/testData/psi/TypeDef.txt @@ -1,7 +1,7 @@ JetFile: TypeDef.jet NAMESPACE NAMESPACE_HEADER - PsiElement(namespace)('namespace') + PsiElement(namespace)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/TypeExpressionAmbiguities_ERR.jet b/compiler/testData/psi/TypeExpressionAmbiguities_ERR.jet index fb993207d65..5050788b08c 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<#(Int, Int, Int)>(if (true) #(1, 1, 1) else #(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 b6eea49385d..d54cf771e6a 100644 --- a/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt +++ b/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt @@ -57,6 +57,7 @@ JetFile: TypeExpressionAmbiguities_ERR.jet TYPE_PROJECTION TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE USER_TYPE @@ -90,6 +91,7 @@ JetFile: TypeExpressionAmbiguities_ERR.jet PsiWhiteSpace(' ') THEN TUPLE + PsiElement(HASH)('#') PsiElement(LPAR)('(') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') @@ -107,6 +109,7 @@ JetFile: TypeExpressionAmbiguities_ERR.jet PsiWhiteSpace(' ') ELSE TUPLE + PsiElement(HASH)('#') PsiElement(LPAR)('(') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('2') diff --git a/compiler/testData/psi/When.jet b/compiler/testData/psi/When.jet index 48f1055329c..21b23b59ad1 100644 --- a/compiler/testData/psi/When.jet +++ b/compiler/testData/psi/When.jet @@ -1,7 +1,7 @@ fun foo() { return false - fun a() = {when(x) { is a => b }} + fun a() = {when(x) { is a -> b }} // foo fun b() {} @@ -13,20 +13,20 @@ fun foo() { } when (e) { - is a => foo + is a -> foo } when (e) { - is Tree @ (a, b) => foo - is null => foo - is 1 => foo - is A.b => foo - is 1.0 => foo - is 'c' => foo - is "sadfsa" => foo - is """ddd""" => foo - is * => foo - is val a is Foo => foo - is (val a is Foo, b) => foo + is Tree #(a, b) -> foo + is null -> foo + is 1 -> foo + is A.b -> foo + is 1.0 -> foo + is 'c' -> foo + is "sadfsa" -> foo + is """ddd""" -> foo + is * -> foo + is val a is Foo -> foo + is #(val a is Foo, b) -> foo } when (when(when (e) { @@ -39,45 +39,45 @@ fun foo() { fun foo() { when (val a = e) { - is Tree => c - is Tree @ (null, val r) => c - is a @ (a, b) => c - is a @ (a, b) => c - is a.a @ (a, b) => c - is a.a @ (foo = a, bar = b) => c - is namespace.a.a @ (a, b) => c - is a @ (val a is T, b) => c - is a @ (b, 1) => c - in 1..2 => dsf - !in 2 => sd - !is t => d - is fun (foo) : Bar => fgpp - is (1, val a is Foo, *, Foo, bar) => d - is (Foo, val a in 1..2, *, val _ !is Foo, val bar is foo.bar @ (a)) => d - is (Int, Int) => 2 - is val a : Foo => 2 - else => foo + is Tree -> c + is Tree #(null, val r) -> c + is a #(a, b) -> c + is a #(a, b) -> c + is a.a #(a, b) -> c + is a.a #(foo = a, bar = b) -> c + is namespace.a.a #(a, b) -> c + is a #(val a is T, b) -> c + is a #(b, 1) -> c + in 1..2 -> dsf + !in 2 -> sd + !is t -> d + is (foo) -> Bar -> fgpp + is #(1, val a is Foo, *, Foo, bar) -> d + is #(Foo, val a in 1..2, *, val _ !is Foo, val bar is foo.bar #(a)) -> d + is #(Int, Int) -> 2 + is val a : Foo -> 2 + else -> foo } } fun foo() { when (val a = e) { is Tree, - is Tree @ (null, val r), - is a @ (a, b) => c + is Tree #(null, val r), + is a #(a, b) -> c 1, foo(), bar, 2 + 3, - is a @ (a, b) => c - is a.a @ (val b, b) => c + is a #(a, b) -> c + is a.a #(val b, b) -> c } } fun whenWithoutCondition(i : Int) { val j = 12 when { - 3 => -1 - i == 3 => -1 - j < i, j == i => -1 - i is Int => 1 - else => 2 + 3 -> -1 + i == 3 -> -1 + j < i, j == i -> -1 + i is Int -> 1 + else -> 2 } } diff --git a/compiler/testData/psi/When.txt b/compiler/testData/psi/When.txt index c78e94c6686..941e79b71f5 100644 --- a/compiler/testData/psi/When.txt +++ b/compiler/testData/psi/When.txt @@ -52,7 +52,7 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') @@ -119,7 +119,7 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -143,10 +143,9 @@ JetFile: When.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Tree') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -164,7 +163,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -177,7 +176,7 @@ JetFile: When.jet NULL PsiElement(null)('null') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -190,7 +189,7 @@ JetFile: When.jet INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -209,7 +208,7 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('b') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -222,7 +221,7 @@ JetFile: When.jet FLOAT_CONSTANT PsiElement(FLOAT_CONSTANT)('1.0') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -235,7 +234,7 @@ JetFile: When.jet CHARACTER_CONSTANT PsiElement(CHARACTER_LITERAL)(''c'') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -251,7 +250,7 @@ JetFile: When.jet PsiElement(REGULAR_STRING_PART)('sadfsa') PsiElement(CLOSING_QUOTE)('"') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -264,7 +263,7 @@ JetFile: When.jet STRING_CONSTANT PsiElement(RAW_STRING_LITERAL)('"""ddd"""') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -276,7 +275,7 @@ JetFile: When.jet WILDCARD_PATTERN PsiElement(MUL)('*') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -300,7 +299,7 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -310,6 +309,7 @@ JetFile: When.jet PsiElement(is)('is') PsiWhiteSpace(' ') TUPLE_PATTERN + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY BINDING_PATTERN @@ -336,7 +336,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -412,7 +412,7 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Tree') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -424,10 +424,9 @@ JetFile: When.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Tree') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY EXPRESSION_PATTERN @@ -443,7 +442,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('r') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -455,10 +454,9 @@ JetFile: When.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -476,7 +474,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -488,10 +486,9 @@ JetFile: When.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -509,7 +506,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -525,10 +522,9 @@ JetFile: When.jet PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -546,7 +542,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -562,10 +558,9 @@ JetFile: When.jet PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY PsiElement(IDENTIFIER)('foo') @@ -591,7 +586,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -611,10 +606,9 @@ JetFile: When.jet PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -632,7 +626,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -644,10 +638,9 @@ JetFile: When.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY BINDING_PATTERN @@ -674,7 +667,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -686,10 +679,9 @@ JetFile: When.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -705,7 +697,7 @@ JetFile: When.jet PsiElement(INTEGER_LITERAL)('1') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -723,7 +715,7 @@ JetFile: When.jet INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('2') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('dsf') @@ -736,7 +728,7 @@ JetFile: When.jet INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('2') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('sd') @@ -751,7 +743,7 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('t') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('d') @@ -759,29 +751,23 @@ JetFile: When.jet WHEN_ENTRY WHEN_CONDITION_IS_PATTERN PsiElement(is)('is') - PsiWhiteSpace(' ') - TYPE_PATTERN - TYPE_REFERENCE - FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') - VALUE_PARAMETER_LIST - PsiElement(LPAR)('(') - VALUE_PARAMETER - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('foo') - PsiElement(RPAR)(')') - PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Bar') + PsiWhiteSpace(' ') + PsiErrorElement:Pattern expected + PsiElement(LPAR)('(') + PsiElement(IDENTIFIER)('foo') + PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Bar') + PsiWhiteSpace(' ') + WHEN_ENTRY + WHEN_CONDITION_IS_PATTERN + EXPRESSION_PATTERN + PsiErrorElement:Expecting an expression, is-condition or in-condition + + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('fgpp') @@ -791,6 +777,7 @@ JetFile: When.jet PsiElement(is)('is') PsiWhiteSpace(' ') TUPLE_PATTERN + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY EXPRESSION_PATTERN @@ -836,7 +823,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('bar') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('d') @@ -846,6 +833,7 @@ JetFile: When.jet PsiElement(is)('is') PsiWhiteSpace(' ') TUPLE_PATTERN + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -923,10 +911,9 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiElement(GT)('>') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -937,7 +924,7 @@ JetFile: When.jet PsiElement(RPAR)(')') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('d') @@ -947,6 +934,7 @@ JetFile: When.jet PsiElement(is)('is') PsiWhiteSpace(' ') TUPLE_PATTERN + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -964,7 +952,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('Int') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('2') @@ -986,7 +974,7 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Foo') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('2') @@ -994,7 +982,7 @@ JetFile: When.jet WHEN_ENTRY PsiElement(else)('else') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -1048,10 +1036,9 @@ JetFile: When.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Tree') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY EXPRESSION_PATTERN @@ -1074,10 +1061,9 @@ JetFile: When.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -1095,7 +1081,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -1142,10 +1128,9 @@ JetFile: When.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -1163,7 +1148,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -1179,10 +1164,9 @@ JetFile: When.jet PsiElement(DOT)('.') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY BINDING_PATTERN @@ -1200,7 +1184,7 @@ JetFile: When.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('c') @@ -1250,7 +1234,7 @@ JetFile: When.jet INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('3') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') PREFIX_EXPRESSION OPERATION_REFERENCE @@ -1271,7 +1255,7 @@ JetFile: When.jet INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('3') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') PREFIX_EXPRESSION OPERATION_REFERENCE @@ -1305,7 +1289,7 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('i') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') PREFIX_EXPRESSION OPERATION_REFERENCE @@ -1329,7 +1313,7 @@ JetFile: When.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Int') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') @@ -1337,7 +1321,7 @@ JetFile: When.jet WHEN_ENTRY PsiElement(else)('else') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('2') diff --git a/compiler/testData/psi/When_ERR.jet b/compiler/testData/psi/When_ERR.jet index f41b6e1b613..e6c6159056f 100644 --- a/compiler/testData/psi/When_ERR.jet +++ b/compiler/testData/psi/When_ERR.jet @@ -2,25 +2,25 @@ fun foo() { when (e) { } when (e) { - is => foo - !is => foo - in => foo - !in => foo - => foo + is -> foo + !is -> foo + in -> foo + !in -> foo + -> foo else } when (e) { - is => - !is => - in => - !in => - !in => ; - => + is -> + !is -> + in -> + !in -> + !in -> ; + -> else - else => + else -> } when (e) { - is - => foo - is (, , 1, , ) => foo + is - -> foo + is #(, , 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 08dede49af4..425e8fb6d67 100644 --- a/compiler/testData/psi/When_ERR.txt +++ b/compiler/testData/psi/When_ERR.txt @@ -41,7 +41,7 @@ JetFile: When_ERR.jet PsiErrorElement:Expecting a type or a decomposer pattern PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -52,7 +52,7 @@ JetFile: When_ERR.jet PsiErrorElement:Expecting a type or a decomposer pattern PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -64,7 +64,7 @@ JetFile: When_ERR.jet PsiErrorElement:Expecting an element PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -76,7 +76,7 @@ JetFile: When_ERR.jet PsiErrorElement:Expecting an element PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -86,7 +86,7 @@ JetFile: When_ERR.jet EXPRESSION_PATTERN PsiErrorElement:Expecting an expression, is-condition or in-condition - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -114,7 +114,7 @@ JetFile: When_ERR.jet PsiErrorElement:Expecting a type or a decomposer pattern PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiErrorElement:Expecting an element PsiWhiteSpace('\n ') @@ -124,7 +124,7 @@ JetFile: When_ERR.jet PsiErrorElement:Expecting a type or a decomposer pattern PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiErrorElement:Expecting an element PsiWhiteSpace('\n ') @@ -135,7 +135,7 @@ JetFile: When_ERR.jet PsiErrorElement:Expecting an element PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiErrorElement:Expecting an element PsiWhiteSpace('\n ') @@ -146,7 +146,7 @@ JetFile: When_ERR.jet PsiErrorElement:Expecting an element PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiErrorElement:Expecting an element PsiWhiteSpace('\n ') @@ -157,7 +157,7 @@ JetFile: When_ERR.jet PsiErrorElement:Expecting an element PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiErrorElement:Expecting an expression PsiWhiteSpace(' ') @@ -168,7 +168,7 @@ JetFile: When_ERR.jet EXPRESSION_PATTERN PsiErrorElement:Expecting an expression, is-condition or in-condition - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiErrorElement:Expecting an element PsiWhiteSpace('\n ') @@ -180,7 +180,7 @@ JetFile: When_ERR.jet WHEN_ENTRY PsiElement(else)('else') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiErrorElement:Expecting an element PsiWhiteSpace('\n ') @@ -203,7 +203,7 @@ JetFile: When_ERR.jet PsiErrorElement:Pattern expected PsiElement(MINUS)('-') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') @@ -213,6 +213,7 @@ JetFile: When_ERR.jet PsiElement(is)('is') PsiWhiteSpace(' ') TUPLE_PATTERN + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiErrorElement:Expecting a pattern PsiElement(COMMA)(',') @@ -233,7 +234,7 @@ JetFile: When_ERR.jet PsiWhiteSpace(' ') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foo') diff --git a/compiler/testData/psi/examples/BinaryTree.jet b/compiler/testData/psi/examples/BinaryTree.jet index 25a5bb1d230..7dc1edcde6e 100644 --- a/compiler/testData/psi/examples/BinaryTree.jet +++ b/compiler/testData/psi/examples/BinaryTree.jet @@ -28,9 +28,9 @@ class BinaryTree : IMutableSet { fun contains(node : TreeNode, item : T) : Boolean { if (node == null) return false when(compare(item, node.value)) { - EQ => true - LS => contains(node.left, item) - GT => contains(node.right, item) + EQ -> true + LS -> contains(node.left, item) + GT -> contains(node.right, item) } } } @@ -51,9 +51,9 @@ class BinaryTree : IMutableSet { return true } when (compare(item, node.value)) { - EQ => false - LS => add(ref node.left, node) - GT => add(ref node.right, node) + EQ -> false + LS -> add(ref node.left, node) + GT -> add(ref node.right, node) } } @@ -64,13 +64,13 @@ class BinaryTree : IMutableSet { return true } when (compare(item, node.value)) { - EQ => return false - LS => + EQ -> return false + LS -> if (node.left == null) { node.left = TreeNode(item, node) return true } else return add(node.left) - GT => + GT -> if (node.right == null) { node.right = TreeNode(item, node) return true @@ -90,19 +90,19 @@ class BinaryTree : IMutableSet { fun find(node : TreeNode) : TreeNode { if (node == null) return null when (compare(item, node.value)) { - EQ => node - LS => find(node.left) - GT => find(node.right) + EQ -> node + LS -> find(node.left) + GT -> find(node.right) } } } private fun remove(node : TreeNode) { when (node) { - is TreeNode @ (null, null) => replace(node, null) - is TreeNode @ (null, right) => replace(node, right) - is TreeNode @ (left, null) => replace(node, left) - is TreeNode @ (left, right) => { + is TreeNode #(null, null) -> replace(node, null) + is TreeNode #(null, right) -> replace(node, right) + is TreeNode #(left, null) -> replace(node, left) + is TreeNode #(left, right) -> { val min = min(node.right) node.value = min.value remove(min) diff --git a/compiler/testData/psi/examples/BinaryTree.txt b/compiler/testData/psi/examples/BinaryTree.txt index af51d25fcf8..358f3eff236 100644 --- a/compiler/testData/psi/examples/BinaryTree.txt +++ b/compiler/testData/psi/examples/BinaryTree.txt @@ -439,7 +439,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('EQ') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BOOLEAN_CONSTANT PsiElement(true)('true') @@ -450,7 +450,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('LS') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') CALL_EXPRESSION REFERENCE_EXPRESSION @@ -477,7 +477,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('GT') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') CALL_EXPRESSION REFERENCE_EXPRESSION @@ -714,7 +714,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('EQ') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BOOLEAN_CONSTANT PsiElement(false)('false') @@ -725,7 +725,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('LS') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') CALL_EXPRESSION REFERENCE_EXPRESSION @@ -754,7 +754,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('GT') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') CALL_EXPRESSION REFERENCE_EXPRESSION @@ -892,7 +892,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('EQ') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') RETURN PsiElement(return)('return') @@ -906,7 +906,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('LS') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace('\n ') IF PsiElement(if)('if') @@ -992,7 +992,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('GT') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace('\n ') IF PsiElement(if)('if') @@ -1263,7 +1263,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('EQ') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('node') @@ -1274,7 +1274,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('LS') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') CALL_EXPRESSION REFERENCE_EXPRESSION @@ -1296,7 +1296,7 @@ JetFile: BinaryTree.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('GT') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') CALL_EXPRESSION REFERENCE_EXPRESSION @@ -1358,10 +1358,9 @@ JetFile: BinaryTree.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('TreeNode') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY EXPRESSION_PATTERN @@ -1375,7 +1374,7 @@ JetFile: BinaryTree.jet PsiElement(null)('null') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') CALL_EXPRESSION REFERENCE_EXPRESSION @@ -1399,10 +1398,9 @@ JetFile: BinaryTree.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('TreeNode') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY EXPRESSION_PATTERN @@ -1418,7 +1416,7 @@ JetFile: BinaryTree.jet PsiElement(IDENTIFIER)('right') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') CALL_EXPRESSION REFERENCE_EXPRESSION @@ -1442,10 +1440,9 @@ JetFile: BinaryTree.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('TreeNode') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -1461,7 +1458,7 @@ JetFile: BinaryTree.jet PsiElement(null)('null') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') CALL_EXPRESSION REFERENCE_EXPRESSION @@ -1485,10 +1482,9 @@ JetFile: BinaryTree.jet DECOMPOSER_PATTERN REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('TreeNode') - PsiWhiteSpace(' ') - PsiElement(AT)('@') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') DECOMPOSER_ARGUMENT_LIST + PsiElement(HASH)('#') PsiElement(LPAR)('(') TUPLE_PATTERN_ENTRY TYPE_PATTERN @@ -1506,7 +1502,7 @@ JetFile: BinaryTree.jet PsiElement(IDENTIFIER)('right') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK PsiElement(LBRACE)('{') diff --git a/compiler/testData/psi/examples/Builder.jet b/compiler/testData/psi/examples/Builder.jet index caf51c29d2c..6f7b80c32b8 100644 --- a/compiler/testData/psi/examples/Builder.jet +++ b/compiler/testData/psi/examples/Builder.jet @@ -31,7 +31,7 @@ class AntBuilder { fun classpath(entries : ClassPathEntry/*...*/) { /*...*/ } } - fun library(initializer : fun Library.() : Library) { + fun library(initializer : Library.() -> Library) { val lib = Library() lib.initializer() return lib diff --git a/compiler/testData/psi/examples/Builder.txt b/compiler/testData/psi/examples/Builder.txt index 2be62e21682..249ae918b3f 100644 --- a/compiler/testData/psi/examples/Builder.txt +++ b/compiler/testData/psi/examples/Builder.txt @@ -398,11 +398,9 @@ JetFile: Builder.jet PsiElement(IDENTIFIER)('initializer') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -412,7 +410,7 @@ JetFile: Builder.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.jet b/compiler/testData/psi/examples/FunctionsAndTypes.jet index 6644dd6b03c..c8d79fed6e8 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.jet +++ b/compiler/testData/psi/examples/FunctionsAndTypes.jet @@ -1,34 +1,34 @@ -type f1 = fun (T) : X +type f1 = (T) -> X // type f1 = {(T) => X} -type f2 = fun (T, E) : X +type f2 = (T, E) -> X // type f2 = {(T, E) => X} -type f_tuple = fun ((T, E)) : X +type f_tuple = (#(T, E)) -> X //type f_tuple = {((T, E)) => X} -type hof = fun (X) : fun (T) : Y +type hof = (X) -> (T) -> Y //type hof = { (X) => {(T) => Y} } -type hof2 = fun (fun (X) : Y) : fun (Y) : Z +type hof2 = ( (X) -> Y) -> (Y) -> Z //type hof2 = { {(X) => Y} => {(Y) => Z} } -type Comparison = fun (a : T, b : T) : Int +type Comparison = (a : T, b : T) -> Int //type Comparison = {(a : T, b : T) => Int} -type Equality = fun (a : T, b : T) : Boolean +type Equality = (a : T, b : T) -> Boolean //type Equality = {(a : T, b : T) => Boolean} -type HashFunction = fun (obj : T) : Int +type HashFunction = (obj : T) -> Int //type HashFunction = {(obj : T) => Int} -type Runnable = fun () : () +type Runnable = () -> #() //type Runnable = {() => ()} -type Function1 = fun (input : T) : R +type Function1 = (input : T) -> R //type Function1 = {(input : T) => R} -val f1 = {(t : T) : X => something(t)} +val f1 = {(t : T) : X -> something(t)} fun f1(t : T) : X = something(t) -val f1 = {(t : T) => something(t)} -val f1 = {(T) : X => something(it)} -val f1 = {t => something(t)} +val f1 = {(t : T) -> something(t)} +val f1 = {(T) : X -> something(it)} +val f1 = {t -> something(t)} val f1 = {something(it)} -val f1 : fun (T) : X = {X()} +val f1 : (T) -> X = {X()} diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.txt b/compiler/testData/psi/examples/FunctionsAndTypes.txt index ca829289aac..704881a598e 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.txt +++ b/compiler/testData/psi/examples/FunctionsAndTypes.txt @@ -10,11 +10,9 @@ JetFile: FunctionsAndTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -24,7 +22,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -41,11 +39,9 @@ JetFile: FunctionsAndTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -62,7 +58,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('E') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -79,16 +75,15 @@ JetFile: FunctionsAndTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') TYPE_REFERENCE USER_TYPE @@ -103,7 +98,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(RPAR)(')') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -120,11 +115,9 @@ JetFile: FunctionsAndTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -134,12 +127,10 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('X') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -149,7 +140,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -166,18 +157,15 @@ JetFile: FunctionsAndTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') + PsiWhiteSpace(' ') VALUE_PARAMETER TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -187,7 +175,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('X') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -195,12 +183,10 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('Y') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -210,7 +196,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('Y') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -233,11 +219,9 @@ JetFile: FunctionsAndTypes.jet PsiElement(GT)('>') PsiWhiteSpace(' ') PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -262,7 +246,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -285,11 +269,9 @@ JetFile: FunctionsAndTypes.jet PsiElement(GT)('>') PsiWhiteSpace(' ') PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -314,7 +296,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -337,11 +319,9 @@ JetFile: FunctionsAndTypes.jet PsiElement(GT)('>') PsiWhiteSpace(' ') PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -355,7 +335,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -372,19 +352,18 @@ JetFile: FunctionsAndTypes.jet TYPE_PARAMETER_LIST PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE TUPLE_TYPE + PsiElement(HASH)('#') PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace('\n') @@ -411,11 +390,9 @@ JetFile: FunctionsAndTypes.jet PsiElement(GT)('>') PsiWhiteSpace(' ') PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -429,7 +406,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -468,7 +445,7 @@ JetFile: FunctionsAndTypes.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('X') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK CALL_EXPRESSION @@ -541,7 +518,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK CALL_EXPRESSION @@ -578,7 +555,7 @@ JetFile: FunctionsAndTypes.jet REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('X') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK CALL_EXPRESSION @@ -606,7 +583,7 @@ JetFile: FunctionsAndTypes.jet VALUE_PARAMETER PsiElement(IDENTIFIER)('t') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK CALL_EXPRESSION @@ -648,11 +625,9 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('f1') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -662,7 +637,7 @@ JetFile: FunctionsAndTypes.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/examples/Graph.jet b/compiler/testData/psi/examples/Graph.jet index 7e373b1e9d6..6999b00c715 100644 --- a/compiler/testData/psi/examples/Graph.jet +++ b/compiler/testData/psi/examples/Graph.jet @@ -24,11 +24,11 @@ class Graph { fun neighbours(v : Vertex) = edges.filter{it.from == v}.map{it.to} // type is IIterable> - fun dfs(handler : fun (V) : Unit) { + fun dfs(handler : (V) -> Unit) { val visited = HashSet>() vertices.foreach{dfs(it, visited, handler)} - fun dfs(current : Vertex, visited : ISet>, handler : fun (V) : Unit) { + fun dfs(current : Vertex, visited : ISet>, handler : (V) -> Unit) { if (!visited.add(current)) return handler(current) @@ -36,7 +36,7 @@ class Graph { } } - public fun traverse(pending : IPushPop>, visited : ISet>, handler : fun (V) : Unit) { + public fun traverse(pending : IPushPop>, visited : ISet>, handler : (V) -> Unit) { vertices.foreach { if (!visited.add(it)) continue @@ -44,7 +44,7 @@ class Graph { while (!pending.isEmpty) { val current = pending.pop() handler(current); - neighbours(current).foreach { n => + neighbours(current).foreach { n -> if (visited.add(n)) { pending.push(n) } diff --git a/compiler/testData/psi/examples/Graph.txt b/compiler/testData/psi/examples/Graph.txt index 2cb4dd908c6..ecd6a20a6c0 100644 --- a/compiler/testData/psi/examples/Graph.txt +++ b/compiler/testData/psi/examples/Graph.txt @@ -469,11 +469,9 @@ JetFile: Graph.jet PsiElement(IDENTIFIER)('handler') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -483,7 +481,7 @@ JetFile: Graph.jet PsiElement(IDENTIFIER)('V') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -612,11 +610,9 @@ JetFile: Graph.jet PsiElement(IDENTIFIER)('handler') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -626,7 +622,7 @@ JetFile: Graph.jet PsiElement(IDENTIFIER)('V') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -784,11 +780,9 @@ JetFile: Graph.jet PsiElement(IDENTIFIER)('handler') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -798,7 +792,7 @@ JetFile: Graph.jet PsiElement(IDENTIFIER)('V') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -935,7 +929,7 @@ JetFile: Graph.jet VALUE_PARAMETER PsiElement(IDENTIFIER)('n') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace('\n ') BLOCK IF diff --git a/compiler/testData/psi/examples/LINQ.jet b/compiler/testData/psi/examples/LINQ.jet index e492a0c22d3..efffad662fd 100644 --- a/compiler/testData/psi/examples/LINQ.jet +++ b/compiler/testData/psi/examples/LINQ.jet @@ -1,3 +1,3 @@ fun foo() { - l filter {it.x} map {it.foo} aggregate {(a, b) => a + b} + l filter {it.x} map {it.foo} aggregate {(a, b) -> a + b} } \ No newline at end of file diff --git a/compiler/testData/psi/examples/LINQ.txt b/compiler/testData/psi/examples/LINQ.txt index 98e0b166b64..c8c78d1a8e9 100644 --- a/compiler/testData/psi/examples/LINQ.txt +++ b/compiler/testData/psi/examples/LINQ.txt @@ -65,7 +65,7 @@ JetFile: LINQ.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') BLOCK BINARY_EXPRESSION diff --git a/compiler/testData/psi/examples/PolymorphicClassObjects.jet b/compiler/testData/psi/examples/PolymorphicClassObjects.jet index fefa5d52ea4..12027ad1994 100644 --- a/compiler/testData/psi/examples/PolymorphicClassObjects.jet +++ b/compiler/testData/psi/examples/PolymorphicClassObjects.jet @@ -16,7 +16,7 @@ class List { } -fun Map.map(f : fun (E) : R) : T where +fun Map.map(f : (E) -> R) : T where T : Iterable, class object T : Buildable = { val builder = T.newBuilder() diff --git a/compiler/testData/psi/examples/PolymorphicClassObjects.txt b/compiler/testData/psi/examples/PolymorphicClassObjects.txt index 9a59c5766da..0ba36037cd1 100644 --- a/compiler/testData/psi/examples/PolymorphicClassObjects.txt +++ b/compiler/testData/psi/examples/PolymorphicClassObjects.txt @@ -242,11 +242,9 @@ JetFile: PolymorphicClassObjects.jet PsiElement(IDENTIFIER)('f') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -256,7 +254,7 @@ JetFile: PolymorphicClassObjects.jet PsiElement(IDENTIFIER)('E') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/examples/With.jet b/compiler/testData/psi/examples/With.jet index 7303da79f0a..c6bf6fa33e2 100644 --- a/compiler/testData/psi/examples/With.jet +++ b/compiler/testData/psi/examples/With.jet @@ -1,4 +1,4 @@ -[inline] fun with(receiver : T, body : fun T.() : Unit) = receiver.body() +[inline] fun with(receiver : T, body : T.() -> Unit) = receiver.body() fun example() { diff --git a/compiler/testData/psi/examples/With.txt b/compiler/testData/psi/examples/With.txt index 468588f148e..fbe340bf2b1 100644 --- a/compiler/testData/psi/examples/With.txt +++ b/compiler/testData/psi/examples/With.txt @@ -39,11 +39,9 @@ JetFile: With.jet PsiElement(IDENTIFIER)('body') PsiWhiteSpace(' ') PsiElement(COLON)(':') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -53,7 +51,7 @@ JetFile: With.jet PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/examples/util/Comparison.jet b/compiler/testData/psi/examples/util/Comparison.jet index 00e8bc10327..ad53be8f67c 100644 --- a/compiler/testData/psi/examples/util/Comparison.jet +++ b/compiler/testData/psi/examples/util/Comparison.jet @@ -1,4 +1,4 @@ -type Comparison = fun (T, T) : Int +type Comparison = (T, T) -> Int fun naturalOrder>(a : T, b : T) : Int = a.compareTo(b) @@ -8,9 +8,9 @@ enum class ComparisonResult { LS; EQ; GR } -type MatchableComparison = fun (T, T) : ComparisonResult +type MatchableComparison = (T, T) -> ComparisonResult -fun asMatchableComparison(cmp : Comparison) : MatchableComparison = {(a, b) => +fun asMatchableComparison(cmp : Comparison) : MatchableComparison = {(a, b) -> val res = cmp(a, b) if (res == 0) return ComparisonResult.EQ if (res < 0) return ComparisonResult.LS diff --git a/compiler/testData/psi/examples/util/Comparison.txt b/compiler/testData/psi/examples/util/Comparison.txt index 53e19e4cb0c..346fde02b9c 100644 --- a/compiler/testData/psi/examples/util/Comparison.txt +++ b/compiler/testData/psi/examples/util/Comparison.txt @@ -16,11 +16,9 @@ JetFile: Comparison.jet PsiElement(GT)('>') PsiWhiteSpace(' ') PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -37,7 +35,7 @@ JetFile: Comparison.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -255,11 +253,9 @@ JetFile: Comparison.jet PsiElement(GT)('>') PsiWhiteSpace(' ') PsiElement(EQ)('=') - PsiWhiteSpace(' ') + PsiWhiteSpace(' ') TYPE_REFERENCE FUNCTION_TYPE - PsiElement(fun)('fun') - PsiWhiteSpace(' ') VALUE_PARAMETER_LIST PsiElement(LPAR)('(') VALUE_PARAMETER @@ -276,7 +272,7 @@ JetFile: Comparison.jet PsiElement(IDENTIFIER)('T') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(COLON)(':') + PsiElement(ARROW)('->') PsiWhiteSpace(' ') TYPE_REFERENCE USER_TYPE @@ -343,7 +339,7 @@ JetFile: Comparison.jet PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - PsiElement(DOUBLE_ARROW)('=>') + PsiElement(ARROW)('->') PsiWhiteSpace('\n ') BLOCK PROPERTY