Functions types with receivers
This commit is contained in:
@@ -42,6 +42,7 @@ public interface JetNodeTypes {
|
||||
JetNodeType LABELED_TUPLE_ENTRY = new JetNodeType("LABELED_TUPLE_ENTRY");
|
||||
JetNodeType TUPLE_TYPE = new JetNodeType("TUPLE_TYPE");
|
||||
JetNodeType VALUE_PARAMETER = new JetNodeType("VALUE_PARAMETER");
|
||||
JetNodeType FUNCTION_TYPE = new JetNodeType("FUNCTION_TYPE");
|
||||
|
||||
|
||||
IElementType NAMESPACE_NAME = new JetNodeType("NAMESPACE_NAME");
|
||||
|
||||
@@ -752,12 +752,14 @@ public class JetParsing {
|
||||
*/
|
||||
private void parseSimpleFunctionType() {
|
||||
assert at(LBRACE);
|
||||
PsiBuilder.Marker functionType = mark();
|
||||
|
||||
advance(); // LBRACE
|
||||
|
||||
parseFunctionTypeContents();
|
||||
|
||||
expect(RBRACE, "Expecting '}");
|
||||
functionType.done(FUNCTION_TYPE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -13,4 +13,13 @@ type f = {(foo, a : a) : b}
|
||||
type f = {(foo, a : {(a) : b}) : b}
|
||||
type f = {(foo, a : {(a) : b}) : {() : ()}}
|
||||
|
||||
type f = {(lazy foo, out a : {(ref a) : b}) : {() : ()}}
|
||||
type f = {(lazy foo, out a : {(ref a) : b}) : {() : ()}}
|
||||
|
||||
type f = T.{() : ()}
|
||||
type f = T.T.{() : ()}
|
||||
type f = T<A, B>.T<x>.{() : ()}
|
||||
type f = (S).{() : ()}.{() : ()}
|
||||
type f = T.{() : ()}.{() : ()}
|
||||
type f = T.T.{() : ()}.{() : ()}
|
||||
type f = T<A, B>.T<x>.{() : ()}.{() : ()}
|
||||
type f = (S).{() : ()}.{() : ()}
|
||||
+771
-413
File diff suppressed because it is too large
Load Diff
@@ -10,29 +10,30 @@ JetFile: FunctionTypes_ERR.jet
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
PsiElement(LBRACE)('{')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
MODIFIER_LIST
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
FUNCTION_TYPE
|
||||
PsiElement(LBRACE)('{')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
MODIFIER_LIST
|
||||
ATTRIBUTE_ANNOTATION
|
||||
PsiElement(LBRACKET)('[')
|
||||
ATTRIBUTE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting ':' followed by a return type
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiErrorElement:Expecting ':' followed by a return type
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
TYPEDEF
|
||||
PsiElement(type)('type')
|
||||
@@ -44,22 +45,23 @@ JetFile: FunctionTypes_ERR.jet
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
PsiElement(LBRACE)('{')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
FUNCTION_TYPE
|
||||
PsiElement(LBRACE)('{')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
PsiErrorElement:Type expected
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
PsiErrorElement:Type expected
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RBRACE)('}')
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RBRACE)('}')
|
||||
Reference in New Issue
Block a user