GreatSyntacticShift: Parser test data fixed

This commit is contained in:
Andrey Breslav
2011-12-21 10:57:09 +02:00
parent 6bad4830c3
commit 91d10790b4
84 changed files with 797 additions and 901 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
namespace foo.bar.goo
package foo.bar.goo
abstract
open
+1 -1
View File
@@ -1,7 +1,7 @@
JetFile: Attributes.jet
NAMESPACE
NAMESPACE_HEADER
PsiElement(namespace)('namespace')
PsiElement(namespace)('package')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
@@ -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
}
}
@@ -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')
+1 -1
View File
@@ -1,4 +1,4 @@
namespace foo.bar.goo
package foo.bar.goo
abstract
open
+1 -1
View File
@@ -1,7 +1,7 @@
JetFile: Attributes_ERR.jet
NAMESPACE
NAMESPACE_HEADER
PsiElement(namespace)('namespace')
PsiElement(namespace)('package')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
+1 -1
View File
@@ -1,4 +1,4 @@
namespace foo
package foo
class Runnable<a,a>(a : doo = 0) : foo(d=0), bar by x, bar {
+1 -1
View File
@@ -1,7 +1,7 @@
JetFile: BabySteps.jet
NAMESPACE
NAMESPACE_HEADER
PsiElement(namespace)('namespace')
PsiElement(namespace)('package')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace('\n\n')
+1 -1
View File
@@ -1,4 +1,4 @@
namespace foo
package foo
class Runnable<a,a>(a : doo = 0) : foo(d=0), ,bar by x, bar {
+1 -1
View File
@@ -1,7 +1,7 @@
JetFile: BabySteps_ERR.jet
NAMESPACE
NAMESPACE_HEADER
PsiElement(namespace)('namespace')
PsiElement(namespace)('package')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('foo')
PsiWhiteSpace('\n\n')
+9 -9
View File
@@ -1,14 +1,14 @@
fun foo() {
when (a) {
a.foo => a
a.foo() => a
a.foo<T> => a
a.foo<T>(a) => a
a.foo<T>(a, d) => a
a.{bar} => a
a.{!bar} => a
a.{() => !bar} => a
else => a
a.foo -> a
a.foo() -> a
a.foo<T> -> a
a.foo<T>(a) -> a
a.foo<T>(a, d) -> a
a.{bar} -> a
a.{!bar} -> a
a.{() -> !bar} -> a
else -> a
}
}
+10 -10
View File
@@ -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')
+1 -1
View File
@@ -1,2 +1,2 @@
/namespace foo.bar
/package foo.bar
import foo
+1 -1
View File
@@ -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')
+19 -19
View File
@@ -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}
}
+49 -64
View File
@@ -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)('}')
PsiErrorElement:Expecting '}
<empty list>
+12 -12
View File
@@ -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}
}
+120 -104
View File
@@ -17,12 +17,10 @@ JetFile: FunctionLiterals_ERR.jet
FUNCTION_LITERAL
PsiElement(LBRACE)('{')
PsiWhiteSpace(' ')
VALUE_PARAMETER_LIST
VALUE_PARAMETER
PsiErrorElement:Expecting parameter name
<empty list>
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
VALUE_PARAMETER_LIST
<empty list>
BLOCK
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
@@ -38,7 +36,7 @@ JetFile: FunctionLiterals_ERR.jet
PsiErrorElement:Expecting ')
<empty list>
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
BLOCK
REFERENCE_EXPRESSION
@@ -60,7 +58,7 @@ JetFile: FunctionLiterals_ERR.jet
<empty list>
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
BLOCK
REFERENCE_EXPRESSION
@@ -87,7 +85,7 @@ JetFile: FunctionLiterals_ERR.jet
PsiErrorElement:Expecting a type
<empty list>
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
<empty list>
@@ -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
<empty list>
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)('}')
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
<empty list>
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
<empty list>
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiErrorElement:Expecting ')
<empty list>
PsiWhiteSpace(' ')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
BLOCK
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('f')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
PsiErrorElement:Expecting '}'
<empty list>
+19 -19
View File
@@ -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<A, B>.T<x>.() : ()
type f = T.() -> #()
type f = T.T.() -> #()
type f = T<A, B>.T<x>.() -> #()
type f = [a] fun T.() : ()
type f = [a] fun T.T.() : ()
type f = [a] fun T<A, B>.T<x>.() : ()
type f = [a] T.() -> #()
type f = [a] T.T.() -> #()
type f = [a] T<A, B>.T<x>.() -> #()
+85 -123
View File
@@ -10,11 +10,9 @@ JetFile: FunctionTypes.jet
TYPE_PARAMETER_LIST
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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)(')')
+1 -1
View File
@@ -1 +1 @@
type f = fun (a, ) : b
type f = (a, ) -> b
+2 -4
View File
@@ -10,11 +10,9 @@ JetFile: FunctionTypes_ERR.jet
TYPE_PARAMETER_LIST
<empty 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
+4 -4
View File
@@ -2,21 +2,21 @@ fun foo()
fun [a] foo()
fun [a] T.foo()
fun [a] T.foo(a : foo) : bar
fun [a()] T.foo<T : fun (a) : b>(a : foo) : bar
fun [a()] T.foo<T : (a) -> b>(a : foo) : bar
fun foo();
fun [a] foo();
fun [a] T.foo();
fun [a] T.foo(a : foo) : bar;
fun [a()] T.foo<T : fun (a) : b>(a : foo) : bar;
fun [a()] T.foo<T : (a) -> b>(a : foo) : bar;
fun foo() {}
fun [a] foo() {}
fun [a] T.foo() {}
fun [a] T.foo(a : foo) : bar {}
fun [a()] T.foo<T : fun (a) : b>(a : foo) : bar {}
fun [a()] T.foo<T : (a) -> b>(a : foo) : bar {}
fun [a()] T.foo<T : [a] fun (a) : b>(a : foo) : bar {}
fun [a()] T.foo<T : [a] (a) -> b>(a : foo) : bar {}
fun A?.foo() : bar?
fun A? .foo() : bar?
+8 -16
View File
@@ -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
+1 -1
View File
@@ -1,4 +1,4 @@
namespace foo.bar.goo
package foo.bar.goo
import namespace.foo
import foo
+1 -1
View File
@@ -1,7 +1,7 @@
JetFile: Imports.jet
NAMESPACE
NAMESPACE_HEADER
PsiElement(namespace)('namespace')
PsiElement(namespace)('package')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
+1 -1
View File
@@ -1,4 +1,4 @@
namespace foo.bar.goo
package foo.bar.goo
import namespace ;
import namespace.*
+4 -4
View File
@@ -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
+1 -1
View File
@@ -6,6 +6,6 @@ fun foo() {
out val foo = 5
[a] var foo = 4
type f = fun T.() : ()
type f = T.() -> #()
}
+3 -4
View File
@@ -109,11 +109,9 @@ JetFile: LocalDeclarations.jet
TYPE_PARAMETER_LIST
<empty 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')
+6 -6
View File
@@ -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<T> {}
namespace foo {}
package foo {}
namespace bar {
package bar {
import sdf
}
+6 -6
View File
@@ -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(' ')
@@ -1,4 +1,4 @@
namespace foobar {
package foobar {
val a = 1
val b = foobar.a
}
@@ -4,7 +4,7 @@ JetFile: NamespaceBlockFirst.jet
<empty list>
NAMESPACE
NAMESPACE_HEADER
PsiElement(namespace)('namespace')
PsiElement(namespace)('package')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('foobar')
PsiWhiteSpace(' ')
+8 -8
View File
@@ -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<T> {}
namespace foo
package foo
namespace {}
package {}
namespace bar {
package bar {
import sdf
}
+9 -9
View File
@@ -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
<empty list>
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
<empty list>
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(' ')
+3 -3
View File
@@ -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 {
}
}
+3 -3
View File
@@ -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(' ')
@@ -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
()
#()
}
+17 -20
View File
@@ -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)('}')
+4 -4
View File
@@ -37,19 +37,19 @@ fun foo() {
t : Any?
t as Any<T>?
t as Any.Any<T>.Any<T>
t as fun () : T
t as () -> T
t as? Any<T>?
t as? Any.Any<T>.Any<T>
t as? fun () : T
t as? () -> T
t : Any * 1
t : Any? * 1
t as Any<T>? * 1
t as Any.Any<T>.Any<T> * 1
t as fun () : T * 1
t as () -> T * 1
t as? Any<T>? * 1
t as? Any.Any<T>.Any<T> * 1
t as? fun () : T * 1
t as? () -> T * 1
++t : Any + 1
a.b : Any + 1
+15 -25
View File
@@ -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
+3 -3
View File
@@ -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) -> {}
}
}
}
+5 -6
View File
@@ -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
<empty list>
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)('{')
+3 -3
View File
@@ -1,6 +1,6 @@
foo bar(1) buzz<T>(1) zoo namespace aa
foo bar(1) buzz<T>(1) zoo package aa
foo bar(1) buzz<T>(1) zoo namespace a {}
foo bar(1) buzz<T>(1) zoo package a {}
foo bar(1) buzz<T>(1) zoo class A
foo bar(1) buzz<T>(1) zoo object B
foo bar(1) buzz<T>(1) zoo fun a() {}
@@ -24,6 +24,6 @@ class Foo {
fun test() {
when (foo bar(1) buzz<T>(1) zoo val a = 1) {
1 => 1
1 -> 1
}
}
+3 -3
View File
@@ -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')
+2 -2
View File
@@ -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<sdf>,
a : foo = (10),
a : foo = (10, "A", 0xf),
a : foo = #(10, "A", 0xf),
a : foo = Foo(bar),
a : foo = Foo<A>(bar),
a : foo = Foo(),
@@ -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')
+1 -1
View File
@@ -1,4 +1,4 @@
namespace foo.bar.goo
package foo.bar.goo
abstract
open
+1 -1
View File
@@ -1,7 +1,7 @@
JetFile: SimpleModifiers.jet
NAMESPACE
NAMESPACE_HEADER
PsiElement(namespace)('namespace')
PsiElement(namespace)('package')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
+1 -1
View File
@@ -1,4 +1,4 @@
namespace foo.bar.goo
package foo.bar.goo
import foo
+1 -1
View File
@@ -1,7 +1,7 @@
JetFile: SoftKeywords.jet
NAMESPACE
NAMESPACE_HEADER
PsiElement(namespace)('namespace')
PsiElement(namespace)('package')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
+2 -2
View File
@@ -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"
+4 -8
View File
@@ -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
+8 -8
View File
@@ -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)
)
+8
View File
@@ -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')
+8 -8
View File
@@ -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)
)
+8
View File
@@ -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')
@@ -1,2 +1,2 @@
val foo = (a = 3)
val foo = (a = 3, a)
val foo = #(a = 3)
val foo = #(a = 3, a)
@@ -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')
+1 -1
View File
@@ -1,4 +1,4 @@
namespace foo.bar.goo
package foo.bar.goo
type foo = bar
type foo<T> = bar
+1 -1
View File
@@ -1,7 +1,7 @@
JetFile: TypeDef.jet
NAMESPACE
NAMESPACE_HEADER
PsiElement(namespace)('namespace')
PsiElement(namespace)('package')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
@@ -1,7 +1,7 @@
fun foo() {
foo<Int?>()
fooo<Double?addddd>()
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<a, b, c>(d))
foo(bar<a, b+1, c>(d))
foo(bar<a, f(), c>(d))
@@ -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')
+40 -40
View File
@@ -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> @ (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> #(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
}
}
+86 -102
View File
@@ -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
<empty list>
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')
+14 -14
View File
@@ -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
}
}
+15 -14
View File
@@ -41,7 +41,7 @@ JetFile: When_ERR.jet
PsiErrorElement:Expecting a type or a decomposer pattern
<empty list>
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
<empty list>
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
@@ -64,7 +64,7 @@ JetFile: When_ERR.jet
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('foo')
@@ -76,7 +76,7 @@ JetFile: When_ERR.jet
PsiErrorElement:Expecting an element
<empty list>
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
<empty list>
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
<empty list>
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace('\n ')
@@ -124,7 +124,7 @@ JetFile: When_ERR.jet
PsiErrorElement:Expecting a type or a decomposer pattern
<empty list>
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace('\n ')
@@ -135,7 +135,7 @@ JetFile: When_ERR.jet
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace('\n ')
@@ -146,7 +146,7 @@ JetFile: When_ERR.jet
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace('\n ')
@@ -157,7 +157,7 @@ JetFile: When_ERR.jet
PsiErrorElement:Expecting an element
<empty list>
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an expression
<empty list>
PsiWhiteSpace(' ')
@@ -168,7 +168,7 @@ JetFile: When_ERR.jet
EXPRESSION_PATTERN
PsiErrorElement:Expecting an expression, is-condition or in-condition
<empty list>
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiErrorElement:Expecting an element
<empty list>
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
<empty list>
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')
+16 -16
View File
@@ -28,9 +28,9 @@ class BinaryTree<T> : IMutableSet<T> {
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<T> : IMutableSet<T> {
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<T> : IMutableSet<T> {
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<T> : IMutableSet<T> {
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)
+24 -28
View File
@@ -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)('{')
+1 -1
View File
@@ -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
+2 -4
View File
@@ -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
@@ -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<in T> = fun (a : T, b : T) : Int
type Comparison<in T> = (a : T, b : T) -> Int
//type Comparison<in T> = {(a : T, b : T) => Int}
type Equality<in T> = fun (a : T, b : T) : Boolean
type Equality<in T> = (a : T, b : T) -> Boolean
//type Equality<in T> = {(a : T, b : T) => Boolean}
type HashFunction<in T> = fun (obj : T) : Int
type HashFunction<in T> = (obj : T) -> Int
//type HashFunction<in T> = {(obj : T) => Int}
type Runnable = fun () : ()
type Runnable = () -> #()
//type Runnable = {() => ()}
type Function1<in T, out R> = fun (input : T) : R
type Function1<in T, out R> = (input : T) -> R
//type Function1<in T, out R> = {(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()}
@@ -10,11 +10,9 @@ JetFile: FunctionsAndTypes.jet
TYPE_PARAMETER_LIST
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
<empty 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
+4 -4
View File
@@ -24,11 +24,11 @@ class Graph<V, E> {
fun neighbours(v : Vertex<V>) = edges.filter{it.from == v}.map{it.to} // type is IIterable<Vertex<V>>
fun dfs(handler : fun (V) : Unit) {
fun dfs(handler : (V) -> Unit) {
val visited = HashSet<Vertex<V>>()
vertices.foreach{dfs(it, visited, handler)}
fun dfs(current : Vertex<V>, visited : ISet<Vertex<V>>, handler : fun (V) : Unit) {
fun dfs(current : Vertex<V>, visited : ISet<Vertex<V>>, handler : (V) -> Unit) {
if (!visited.add(current))
return
handler(current)
@@ -36,7 +36,7 @@ class Graph<V, E> {
}
}
public fun traverse(pending : IPushPop<Vertex<V>>, visited : ISet<Vertex<V>>, handler : fun (V) : Unit) {
public fun traverse(pending : IPushPop<Vertex<V>>, visited : ISet<Vertex<V>>, handler : (V) -> Unit) {
vertices.foreach {
if (!visited.add(it))
continue
@@ -44,7 +44,7 @@ class Graph<V, E> {
while (!pending.isEmpty) {
val current = pending.pop()
handler(current);
neighbours(current).foreach { n =>
neighbours(current).foreach { n ->
if (visited.add(n)) {
pending.push(n)
}
+7 -13
View File
@@ -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
+1 -1
View File
@@ -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}
}
+1 -1
View File
@@ -65,7 +65,7 @@ JetFile: LINQ.jet
PsiElement(IDENTIFIER)('b')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
PsiElement(DOUBLE_ARROW)('=>')
PsiElement(ARROW)('->')
PsiWhiteSpace(' ')
BLOCK
BINARY_EXPRESSION
@@ -16,7 +16,7 @@ class List<T> {
}
fun <E, T, R> Map<E, T>.map(f : fun (E) : R) : T<R> where
fun <E, T, R> Map<E, T>.map(f : (E) -> R) : T<R> where
T : Iterable<E>,
class object T : Buildable<E, T> = {
val builder = T.newBuilder()
@@ -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
+1 -1
View File
@@ -1,4 +1,4 @@
[inline] fun with<T>(receiver : T, body : fun T.() : Unit) = receiver.body()
[inline] fun with<T>(receiver : T, body : T.() -> Unit) = receiver.body()
fun example() {
+2 -4
View File
@@ -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
@@ -1,4 +1,4 @@
type Comparison<in T> = fun (T, T) : Int
type Comparison<in T> = (T, T) -> Int
fun naturalOrder<in T : Comparable<T>>(a : T, b : T) : Int = a.compareTo(b)
@@ -8,9 +8,9 @@ enum class ComparisonResult {
LS; EQ; GR
}
type MatchableComparison<in T> = fun (T, T) : ComparisonResult
type MatchableComparison<in T> = (T, T) -> ComparisonResult
fun asMatchableComparison<T>(cmp : Comparison<T>) : MatchableComparison<T> = {(a, b) =>
fun asMatchableComparison<T>(cmp : Comparison<T>) : MatchableComparison<T> = {(a, b) ->
val res = cmp(a, b)
if (res == 0) return ComparisonResult.EQ
if (res < 0) return ComparisonResult.LS
@@ -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