Tests for basic class member cases
This commit is contained in:
@@ -50,6 +50,7 @@ public interface JetNodeTypes {
|
||||
JetNodeType CONSTRUCTOR = new JetNodeType("CONSTRUCTOR");
|
||||
JetNodeType INITIALIZER_LIST = new JetNodeType("INITIALIZER_LIST");
|
||||
JetNodeType THIS_CALL = new JetNodeType("THIS_CALL");
|
||||
JetNodeType BLOCK = new JetNodeType("BLOCK");
|
||||
|
||||
IElementType NAMESPACE_NAME = new JetNodeType("NAMESPACE_NAME");
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ import static org.jetbrains.jet.lexer.JetTokens.*;
|
||||
}
|
||||
|
||||
protected IElementType lookahead(int k) {
|
||||
// TODO: use a faster implementation
|
||||
PsiBuilder.Marker tmp = mark();
|
||||
for (int i = 0; i < k; i++) advance();
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package org.jetbrains.jet.lang.parsing;
|
||||
|
||||
import com.intellij.lang.PsiBuilder;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
import org.jetbrains.jet.JetNodeType;
|
||||
|
||||
import static org.jetbrains.jet.JetNodeTypes.NAMED_ARGUMENT;
|
||||
import static org.jetbrains.jet.JetNodeTypes.VALUE_ARGUMENT;
|
||||
import static org.jetbrains.jet.JetNodeTypes.VALUE_ARGUMENT_LIST;
|
||||
import static org.jetbrains.jet.JetNodeTypes.*;
|
||||
import static org.jetbrains.jet.lexer.JetTokens.*;
|
||||
|
||||
/**
|
||||
@@ -50,11 +49,9 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
||||
* ;
|
||||
*/
|
||||
public void parseValueArgumentList() {
|
||||
assert at(LPAR);
|
||||
|
||||
PsiBuilder.Marker list = mark();
|
||||
|
||||
advance(); // LPAR
|
||||
expect(LPAR, "Expecting a parameter list", TokenSet.create(RPAR));
|
||||
|
||||
if (!at(RPAR)) {
|
||||
while (true) {
|
||||
|
||||
@@ -536,7 +536,7 @@ public class JetParsing extends AbstractJetParsing {
|
||||
while (true) {
|
||||
if (at(COMMA)) errorAndAdvance("Expecting a this or super constructor call");
|
||||
parseInitializer();
|
||||
if (at(COMMA)) break;
|
||||
if (!at(COMMA)) break;
|
||||
advance(); // COMMA
|
||||
}
|
||||
list.done(INITIALIZER_LIST);
|
||||
@@ -557,9 +557,13 @@ public class JetParsing extends AbstractJetParsing {
|
||||
advance(); // THIS_KEYWORD
|
||||
type = THIS_CALL;
|
||||
}
|
||||
else {
|
||||
else if (atSet(TYPE_REF_FIRST)) {
|
||||
parseTypeRef();
|
||||
type = DELEGATOR_SUPER_CALL;
|
||||
} else {
|
||||
errorWithRecovery("Expecting constructor call (this(...)) or supertype initializer", TokenSet.create(LBRACE, COMMA));
|
||||
initializer.drop();
|
||||
return;
|
||||
}
|
||||
myExpressionParsing.parseValueArgumentList();
|
||||
|
||||
@@ -620,10 +624,6 @@ public class JetParsing extends AbstractJetParsing {
|
||||
}
|
||||
else {
|
||||
createTruncatedBuilder(lastDot).parseTypeRef();
|
||||
// // The code below is NOT REENTRANT
|
||||
// myBuilder.setEOFPosition(lastDot);
|
||||
// parseTypeRef();
|
||||
// myBuilder.unSetEOFPosition();
|
||||
|
||||
expect(DOT, "Expecting '.' before a property name", propertyNameFollow);
|
||||
expect(IDENTIFIER, "Expecting property name", propertyNameFollow);
|
||||
@@ -716,10 +716,6 @@ public class JetParsing extends AbstractJetParsing {
|
||||
expect(IDENTIFIER, "Expecting function name or receiver type");
|
||||
} else {
|
||||
createTruncatedBuilder(lastDot).parseTypeRef();
|
||||
// // The code below in NOT REENTRANT
|
||||
// myBuilder.setEOFPosition(lastDot);
|
||||
// parseTypeRef();
|
||||
// myBuilder.unSetEOFPosition();
|
||||
|
||||
TokenSet functionNameFollow = TokenSet.create(LT, LPAR, COLON, EQ);
|
||||
expect(DOT, "Expecting '.' before a function name", functionNameFollow);
|
||||
@@ -835,6 +831,8 @@ public class JetParsing extends AbstractJetParsing {
|
||||
private void parseBlock() {
|
||||
assert at(LBRACE);
|
||||
|
||||
PsiBuilder.Marker block = mark();
|
||||
|
||||
advance(); // LBRACE
|
||||
|
||||
while (!eof() && !at(RBRACE)) {
|
||||
@@ -843,6 +841,8 @@ public class JetParsing extends AbstractJetParsing {
|
||||
}
|
||||
|
||||
expect(RBRACE, "Expecting '}");
|
||||
|
||||
block.done(BLOCK);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1043,10 +1043,6 @@ public class JetParsing extends AbstractJetParsing {
|
||||
|
||||
int lastId = findLastBefore(TokenSet.create(IDENTIFIER), TokenSet.create(COMMA, GT, COLON), false);
|
||||
createTruncatedBuilder(lastId).parseModifierList();
|
||||
// // The code below is NOT REENTRANT
|
||||
// myBuilder.setEOFPosition(lastId);
|
||||
// parseModifierList();
|
||||
// myBuilder.unSetEOFPosition();
|
||||
|
||||
expect(IDENTIFIER, "Type parameter name expected", TokenSet.EMPTY);
|
||||
|
||||
@@ -1275,10 +1271,6 @@ public class JetParsing extends AbstractJetParsing {
|
||||
|
||||
int lastId = findLastBefore(TokenSet.create(IDENTIFIER), TokenSet.create(COMMA, RPAR, COLON), false);
|
||||
createTruncatedBuilder(lastId).parseModifierList();
|
||||
// // The code below is NOT REENTRANT
|
||||
// myBuilder.setEOFPosition(lastId);
|
||||
// parseModifierList();
|
||||
// myBuilder.unSetEOFPosition();
|
||||
|
||||
if (!parseFunctionParameterRest()) {
|
||||
parameter.rollbackTo();
|
||||
|
||||
@@ -412,8 +412,9 @@ JetFile: Functions.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
@@ -433,8 +434,9 @@ JetFile: Functions.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
@@ -458,8 +460,9 @@ JetFile: Functions.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
@@ -512,8 +515,9 @@ JetFile: Functions.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
@@ -551,8 +555,9 @@ JetFile: Functions.jet
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
@@ -615,5 +620,6 @@ JetFile: Functions.jet
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -98,8 +98,9 @@ JetFile: Properties.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_GETTER
|
||||
PsiElement(set)('set')
|
||||
@@ -151,8 +152,9 @@ JetFile: Properties.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_GETTER
|
||||
PsiElement(set)('set')
|
||||
@@ -160,8 +162,9 @@ JetFile: Properties.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
@@ -220,8 +223,9 @@ JetFile: Properties.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_GETTER
|
||||
MODIFIER_LIST
|
||||
@@ -240,8 +244,9 @@ JetFile: Properties.jet
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
@@ -300,8 +305,9 @@ JetFile: Properties.jet
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
@@ -360,7 +366,8 @@ JetFile: Properties.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -115,8 +115,9 @@ JetFile: Properties_ERR.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_GETTER
|
||||
PsiErrorElement:Expecting 'get' or 'set'
|
||||
@@ -170,8 +171,9 @@ JetFile: Properties_ERR.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_GETTER
|
||||
PsiElement(set)('set')
|
||||
@@ -180,8 +182,9 @@ JetFile: Properties_ERR.jet
|
||||
<empty list>
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n')
|
||||
@@ -225,8 +228,9 @@ JetFile: Properties_ERR.jet
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_GETTER
|
||||
PsiElement(set)('set')
|
||||
@@ -234,8 +238,9 @@ JetFile: Properties_ERR.jet
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiErrorElement:Expecting '}'
|
||||
PsiElement(IDENTIFIER)('set')
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
class foo {
|
||||
|
||||
extension foo for X {
|
||||
extension foo for X {
|
||||
|
||||
}
|
||||
|
||||
class Bar {}
|
||||
|
||||
fun foo()
|
||||
|
||||
val x
|
||||
|
||||
var f
|
||||
|
||||
type foo = bar
|
||||
|
||||
decomposer (a, b, c)
|
||||
|
||||
this() : this(a, b, c), Foo<T>(bar)
|
||||
}
|
||||
|
||||
class Bar {
|
||||
extension foo for X {
|
||||
|
||||
}
|
||||
|
||||
class Bar {}
|
||||
|
||||
fun foo()
|
||||
|
||||
val x
|
||||
|
||||
var f
|
||||
|
||||
type foo = bar
|
||||
|
||||
decomposer (a, b, c)
|
||||
|
||||
this() : this(a, b, c), Foo<T>(bar)
|
||||
}
|
||||
|
||||
fun foo()
|
||||
|
||||
val x
|
||||
|
||||
var f
|
||||
|
||||
type foo = bar
|
||||
|
||||
decomposer (a, b, c)
|
||||
|
||||
this() : this(a, b, c), Foo<T>(bar)
|
||||
|
||||
this() : this(a, b, c), Foo<T>(bar) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,415 @@
|
||||
JetFile: SimpleClassMembers.jet
|
||||
NAMESPACE
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
EXTENSION
|
||||
PsiElement(extension)('extension')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
EXTENSION
|
||||
PsiElement(extension)('extension')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PROPERTY
|
||||
PsiElement(var)('var')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
TYPEDEF
|
||||
PsiElement(type)('type')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
DECOMPOSER
|
||||
PsiElement(decomposer)('decomposer')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_PROPERTY_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CONSTRUCTOR
|
||||
PsiElement(this)('this')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
INITIALIZER_LIST
|
||||
THIS_CALL
|
||||
PsiElement(this)('this')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DELEGATOR_SUPER_CALL
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
EXTENSION
|
||||
PsiElement(extension)('extension')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PsiElement(for)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('X')
|
||||
PsiWhiteSpace(' ')
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CLASS
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('Bar')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
CLASS_BODY
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PROPERTY
|
||||
PsiElement(var)('var')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
TYPEDEF
|
||||
PsiElement(type)('type')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
DECOMPOSER
|
||||
PsiElement(decomposer)('decomposer')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_PROPERTY_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CONSTRUCTOR
|
||||
PsiElement(this)('this')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
INITIALIZER_LIST
|
||||
THIS_CALL
|
||||
PsiElement(this)('this')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DELEGATOR_SUPER_CALL
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
FUN
|
||||
PsiElement(fun)('fun')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PROPERTY
|
||||
PsiElement(val)('val')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('x')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PROPERTY
|
||||
PsiElement(var)('var')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('f')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
TYPEDEF
|
||||
PsiElement(type)('type')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_PARAMETER_LIST
|
||||
<empty list>
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
DECOMPOSER
|
||||
PsiElement(decomposer)('decomposer')
|
||||
PsiWhiteSpace(' ')
|
||||
DECOMPOSER_PROPERTY_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CONSTRUCTOR
|
||||
PsiElement(this)('this')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
INITIALIZER_LIST
|
||||
THIS_CALL
|
||||
PsiElement(this)('this')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DELEGATOR_SUPER_CALL
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CONSTRUCTOR
|
||||
PsiElement(this)('this')
|
||||
VALUE_PARAMETER_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(COLON)(':')
|
||||
PsiWhiteSpace(' ')
|
||||
INITIALIZER_LIST
|
||||
THIS_CALL
|
||||
PsiElement(this)('this')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('a')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('b')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('c')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
DELEGATOR_SUPER_CALL
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('Foo')
|
||||
TYPE_ARGUMENT_LIST
|
||||
PsiElement(LT)('<')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
PsiElement(IDENTIFIER)('T')
|
||||
PsiElement(GT)('>')
|
||||
VALUE_ARGUMENT_LIST
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -305,8 +305,9 @@ JetFile: SoftKeywords.jet
|
||||
PsiElement(IDENTIFIER)('s')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
BLOCK
|
||||
PsiElement(LBRACE)('{')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
|
||||
@@ -53,4 +53,5 @@ public class JetParsingTest extends ParsingTestCase {
|
||||
public void testExtensions() throws Exception {doTest(true);}
|
||||
public void testExtensions_ERR() throws Exception {doTest(true);}
|
||||
public void testSoftKeywords() throws Exception {doTest(true);}
|
||||
public void testSimpleClassMembers() throws Exception {doTest(true);}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user