Newlines disabled inside () and [], enabled inside {}
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
if
|
if
|
||||||
: "if" "(" expression ")" expression ("else" expression)?
|
: "if" "(" expression ")" expression SEMI? ("else" expression)?
|
||||||
;
|
;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ functionLiteral // one can use "it" as a parameter name
|
|||||||
;
|
;
|
||||||
|
|
||||||
expressions
|
expressions
|
||||||
: expression{SEMI} SEMI?
|
: SEMI* expression{SEMI+} SEMI*
|
||||||
;
|
;
|
||||||
|
|
||||||
constructorInvocation
|
constructorInvocation
|
||||||
|
|||||||
@@ -298,6 +298,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
PsiBuilder.Marker indices = mark();
|
PsiBuilder.Marker indices = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
advance(); // LBRACKET
|
advance(); // LBRACKET
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -312,6 +313,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(RBRACKET, "Expecting ']'");
|
expect(RBRACKET, "Expecting ']'");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
indices.done(INDICES);
|
indices.done(INDICES);
|
||||||
}
|
}
|
||||||
@@ -357,6 +359,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
PsiBuilder.Marker literal = mark();
|
PsiBuilder.Marker literal = mark();
|
||||||
|
|
||||||
|
myBuilder.enableEols();
|
||||||
advance(); // LBRACE
|
advance(); // LBRACE
|
||||||
|
|
||||||
int doubleArrowPos = matchTokenStreamPredicate(new FirstBefore(new At(DOUBLE_ARROW), new At(RBRACE)) {
|
int doubleArrowPos = matchTokenStreamPredicate(new FirstBefore(new At(DOUBLE_ARROW), new At(RBRACE)) {
|
||||||
@@ -430,6 +433,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
body.done(BODY);
|
body.done(BODY);
|
||||||
|
|
||||||
expect(RBRACE, "Expecting '}'");
|
expect(RBRACE, "Expecting '}'");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
literal.done(FUNCTION_LITERAL);
|
literal.done(FUNCTION_LITERAL);
|
||||||
}
|
}
|
||||||
@@ -441,6 +445,8 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
PsiBuilder.Marker list = mark();
|
PsiBuilder.Marker list = mark();
|
||||||
expect(LPAR, "Expecting a parameter list in parentheses (...)", TokenSet.create(DOUBLE_ARROW, COLON));
|
expect(LPAR, "Expecting a parameter list in parentheses (...)", TokenSet.create(DOUBLE_ARROW, COLON));
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
|
|
||||||
if (!at(RPAR)) {
|
if (!at(RPAR)) {
|
||||||
while (true) {
|
while (true) {
|
||||||
if (at(COMMA)) errorAndAdvance("Expecting a parameter declaration");
|
if (at(COMMA)) errorAndAdvance("Expecting a parameter declaration");
|
||||||
@@ -466,19 +472,22 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
expect(RPAR, "Expecting ')", TokenSet.create(DOUBLE_ARROW, COLON));
|
expect(RPAR, "Expecting ')", TokenSet.create(DOUBLE_ARROW, COLON));
|
||||||
list.done(VALUE_PARAMETER_LIST);
|
list.done(VALUE_PARAMETER_LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* expressions
|
* expressions
|
||||||
* : expression{SEMI} SEMI?
|
* : SEMI* expression{SEMI+} SEMI*
|
||||||
*/
|
*/
|
||||||
public void parseExpressions() {
|
public void parseExpressions() {
|
||||||
|
while (at(SEMICOLON)) advance(); // SEMICOLON
|
||||||
while (!eof() && !at(RBRACE)) {
|
while (!eof() && !at(RBRACE)) {
|
||||||
parseExpression();
|
parseExpression();
|
||||||
if (at(SEMICOLON)) {
|
if (at(SEMICOLON)) {
|
||||||
advance(); // SEMICOLON
|
while (at(SEMICOLON)) advance(); // SEMICOLON
|
||||||
} else if (at(RBRACE)) {
|
} else if (at(RBRACE)) {
|
||||||
break;
|
break;
|
||||||
} else if (!myBuilder.eolInLastWhitespace()) {
|
} else if (!myBuilder.eolInLastWhitespace()) {
|
||||||
@@ -532,7 +541,9 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
advance(); // DO_KEYWORD
|
advance(); // DO_KEYWORD
|
||||||
|
|
||||||
parseControlStructureBody();
|
if (!at(WHILE_KEYWORD)) {
|
||||||
|
parseControlStructureBody();
|
||||||
|
}
|
||||||
|
|
||||||
expect(WHILE_KEYWORD, "Expecting 'while' followed by a post-condition");
|
expect(WHILE_KEYWORD, "Expecting 'while' followed by a post-condition");
|
||||||
|
|
||||||
@@ -572,6 +583,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
advance(); // FOR_KEYWORD
|
advance(); // FOR_KEYWORD
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
expect(LPAR, "Expecting '(' to open a loop range", TokenSet.create(RPAR, VAL_KEYWORD, VAR_KEYWORD, IDENTIFIER));
|
expect(LPAR, "Expecting '(' to open a loop range", TokenSet.create(RPAR, VAL_KEYWORD, VAR_KEYWORD, IDENTIFIER));
|
||||||
|
|
||||||
PsiBuilder.Marker parameter = mark();
|
PsiBuilder.Marker parameter = mark();
|
||||||
@@ -590,6 +602,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
range.done(LOOP_RANGE);
|
range.done(LOOP_RANGE);
|
||||||
|
|
||||||
expectNoAdvance(RPAR, "Expecting ')'");
|
expectNoAdvance(RPAR, "Expecting ')'");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
parseControlStructureBody();
|
parseControlStructureBody();
|
||||||
|
|
||||||
@@ -601,10 +614,9 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
*/
|
*/
|
||||||
private void parseControlStructureBody() {
|
private void parseControlStructureBody() {
|
||||||
PsiBuilder.Marker body = mark();
|
PsiBuilder.Marker body = mark();
|
||||||
parseExpression();
|
if (!at(SEMICOLON))
|
||||||
|
parseExpression();
|
||||||
body.done(BODY);
|
body.done(BODY);
|
||||||
|
|
||||||
// TODO: empty body?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -653,7 +665,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* if
|
* if
|
||||||
* : "if" "(" expression ")" expression ("else" expression)?
|
* : "if" "(" expression ")" expression SEMI? ("else" expression)?
|
||||||
* ;
|
* ;
|
||||||
*/
|
*/
|
||||||
private void parseIf() {
|
private void parseIf() {
|
||||||
@@ -665,16 +677,20 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
parseCondition();
|
parseCondition();
|
||||||
|
|
||||||
// TODO: empty body?
|
|
||||||
PsiBuilder.Marker thenBranch = mark();
|
PsiBuilder.Marker thenBranch = mark();
|
||||||
parseExpression();
|
if (!at(ELSE_KEYWORD) && !at(SEMICOLON)) {
|
||||||
|
parseExpression();
|
||||||
|
}
|
||||||
|
consumeIf(SEMICOLON);
|
||||||
thenBranch.done(THEN);
|
thenBranch.done(THEN);
|
||||||
|
|
||||||
if (at(ELSE_KEYWORD)) {
|
if (at(ELSE_KEYWORD)) {
|
||||||
advance(); // ELSE_KEYWORD
|
advance(); // ELSE_KEYWORD
|
||||||
|
|
||||||
PsiBuilder.Marker elseBranch = mark();
|
PsiBuilder.Marker elseBranch = mark();
|
||||||
parseExpression();
|
if (!at(SEMICOLON)) {
|
||||||
|
parseExpression();
|
||||||
|
}
|
||||||
elseBranch.done(ELSE);
|
elseBranch.done(ELSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,6 +701,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
* "(" expression ")"
|
* "(" expression ")"
|
||||||
*/
|
*/
|
||||||
private void parseCondition() {
|
private void parseCondition() {
|
||||||
|
myBuilder.disableEols();
|
||||||
expect(LPAR, "Expecting a condition in parentheses '(...)'");
|
expect(LPAR, "Expecting a condition in parentheses '(...)'");
|
||||||
|
|
||||||
PsiBuilder.Marker condition = mark();
|
PsiBuilder.Marker condition = mark();
|
||||||
@@ -692,6 +709,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
condition.done(CONDITION);
|
condition.done(CONDITION);
|
||||||
|
|
||||||
expect(RPAR, "Expecting ')");
|
expect(RPAR, "Expecting ')");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -769,23 +787,15 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
PsiBuilder.Marker typeof = mark();
|
PsiBuilder.Marker typeof = mark();
|
||||||
advance(); // TYPEOF_KEYWORD
|
advance(); // TYPEOF_KEYWORD
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
expect(LPAR, "Expecting '('");
|
expect(LPAR, "Expecting '('");
|
||||||
parseExpression();
|
|
||||||
expect(RPAR, "Expecting ')'");
|
|
||||||
typeof.done(TYPEOF);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* mapLiteralEntry
|
|
||||||
* : expression ":" expression
|
|
||||||
* ;
|
|
||||||
*/
|
|
||||||
private void parseMapLiteralEntry() {
|
|
||||||
PsiBuilder.Marker entry = mark();
|
|
||||||
parseExpression();
|
parseExpression();
|
||||||
expect(COLON, "Expecting ':'");
|
|
||||||
parseExpression();
|
expect(RPAR, "Expecting ')'");
|
||||||
entry.done(MAP_LITERAL_ENTRY);
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
|
typeof.done(TYPEOF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -798,8 +808,10 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
PsiBuilder.Marker mark = mark();
|
PsiBuilder.Marker mark = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
advance(); // LPAR
|
advance(); // LPAR
|
||||||
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (at(COMMA)) errorAndAdvance("Expecting a tuple entry (expression)");
|
if (at(COMMA)) errorAndAdvance("Expecting a tuple entry (expression)");
|
||||||
parseExpression();
|
parseExpression();
|
||||||
@@ -808,6 +820,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(RPAR, "Expecting ')'");
|
expect(RPAR, "Expecting ')'");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
mark.done(TUPLE);
|
mark.done(TUPLE);
|
||||||
}
|
}
|
||||||
@@ -822,6 +835,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
// This may be "this < foo" or "this<foo>", thus the backtracking
|
// This may be "this < foo" or "this<foo>", thus the backtracking
|
||||||
PsiBuilder.Marker supertype = mark();
|
PsiBuilder.Marker supertype = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
advance(); // LT
|
advance(); // LT
|
||||||
|
|
||||||
myJetParsing.parseTypeRef();
|
myJetParsing.parseTypeRef();
|
||||||
@@ -833,6 +847,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
else {
|
else {
|
||||||
supertype.rollbackTo();
|
supertype.rollbackTo();
|
||||||
}
|
}
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -844,6 +859,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
public void parseValueArgumentList() {
|
public void parseValueArgumentList() {
|
||||||
PsiBuilder.Marker list = mark();
|
PsiBuilder.Marker list = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
expect(LPAR, "Expecting a parameter list", TokenSet.create(RPAR));
|
expect(LPAR, "Expecting a parameter list", TokenSet.create(RPAR));
|
||||||
|
|
||||||
if (!at(RPAR)) {
|
if (!at(RPAR)) {
|
||||||
@@ -855,6 +871,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(RPAR, "Expecting ')'");
|
expect(RPAR, "Expecting ')'");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
list.done(VALUE_ARGUMENT_LIST);
|
list.done(VALUE_ARGUMENT_LIST);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -239,6 +239,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
PsiBuilder.Marker properties = mark();
|
PsiBuilder.Marker properties = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
expect(LPAR, "Expecting a property list in parentheses '( ... )'");
|
expect(LPAR, "Expecting a property list in parentheses '( ... )'");
|
||||||
|
|
||||||
// Property list
|
// Property list
|
||||||
@@ -259,6 +260,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(RPAR, "Expecting ')' to close a property list");
|
expect(RPAR, "Expecting ')' to close a property list");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
consumeIf(SEMICOLON);
|
consumeIf(SEMICOLON);
|
||||||
|
|
||||||
@@ -314,6 +316,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
assert at(LBRACKET);
|
assert at(LBRACKET);
|
||||||
PsiBuilder.Marker annotation = mark();
|
PsiBuilder.Marker annotation = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
advance(); // LBRACKET
|
advance(); // LBRACKET
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -329,6 +332,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(RBRACKET, "Expecting ']' to close an attribute annotation");
|
expect(RBRACKET, "Expecting ']' to close an attribute annotation");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
annotation.done(ATTRIBUTE_ANNOTATION);
|
annotation.done(ATTRIBUTE_ANNOTATION);
|
||||||
}
|
}
|
||||||
@@ -370,6 +374,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
return NAMESPACE;
|
return NAMESPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myBuilder.enableEols();
|
||||||
advance(); // LBRACE
|
advance(); // LBRACE
|
||||||
PsiBuilder.Marker namespaceBody = mark();
|
PsiBuilder.Marker namespaceBody = mark();
|
||||||
|
|
||||||
@@ -377,6 +382,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
namespaceBody.done(NAMESPACE_BODY);
|
namespaceBody.done(NAMESPACE_BODY);
|
||||||
expect(RBRACE, "Expecting '}'");
|
expect(RBRACE, "Expecting '}'");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
return NAMESPACE;
|
return NAMESPACE;
|
||||||
}
|
}
|
||||||
@@ -430,6 +436,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
PsiBuilder.Marker classBody = mark();
|
PsiBuilder.Marker classBody = mark();
|
||||||
|
|
||||||
|
myBuilder.enableEols();
|
||||||
advance(); // LBRACE
|
advance(); // LBRACE
|
||||||
|
|
||||||
while (!eof() && !at(RBRACE)) {
|
while (!eof() && !at(RBRACE)) {
|
||||||
@@ -459,6 +466,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(RBRACE, "Expecting '}' to close enum class body");
|
expect(RBRACE, "Expecting '}' to close enum class body");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
classBody.done(CLASS_BODY);
|
classBody.done(CLASS_BODY);
|
||||||
}
|
}
|
||||||
@@ -500,6 +508,8 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
/*package*/ void parseClassBody() {
|
/*package*/ void parseClassBody() {
|
||||||
assert at(LBRACE);
|
assert at(LBRACE);
|
||||||
PsiBuilder.Marker body = mark();
|
PsiBuilder.Marker body = mark();
|
||||||
|
|
||||||
|
myBuilder.enableEols();
|
||||||
advance(); // LBRACE
|
advance(); // LBRACE
|
||||||
|
|
||||||
while (!eof()) {
|
while (!eof()) {
|
||||||
@@ -509,6 +519,8 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
parseMemberDeclaration();
|
parseMemberDeclaration();
|
||||||
}
|
}
|
||||||
expect(RBRACE, "Missing '}");
|
expect(RBRACE, "Missing '}");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
body.done(CLASS_BODY);
|
body.done(CLASS_BODY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -766,6 +778,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
boolean setter = at(SET_KEYWORD);
|
boolean setter = at(SET_KEYWORD);
|
||||||
advance(); // GET_KEYWORD or SET_KEYWORD
|
advance(); // GET_KEYWORD or SET_KEYWORD
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
expect(LPAR, "Expecting '('", TokenSet.create(RPAR, IDENTIFIER, COLON, LBRACE, EQ));
|
expect(LPAR, "Expecting '('", TokenSet.create(RPAR, IDENTIFIER, COLON, LBRACE, EQ));
|
||||||
if (setter) {
|
if (setter) {
|
||||||
PsiBuilder.Marker setterParameter = mark();
|
PsiBuilder.Marker setterParameter = mark();
|
||||||
@@ -782,6 +795,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
if (!at(RPAR)) errorUntil("Expecting ')'", TokenSet.create(RPAR, COLON, LBRACE, EQ, EOL_OR_SEMICOLON));
|
if (!at(RPAR)) errorUntil("Expecting ')'", TokenSet.create(RPAR, COLON, LBRACE, EQ, EOL_OR_SEMICOLON));
|
||||||
expect(RPAR, "Expecting ')'", TokenSet.create(RPAR, COLON, LBRACE, EQ));
|
expect(RPAR, "Expecting ')'", TokenSet.create(RPAR, COLON, LBRACE, EQ));
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
if (at(COLON)) {
|
if (at(COLON)) {
|
||||||
advance();
|
advance();
|
||||||
@@ -827,7 +841,6 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
parseTypeParameterList(TokenSet.orSet(TokenSet.create(LPAR), valueParametersFollow));
|
parseTypeParameterList(TokenSet.orSet(TokenSet.create(LPAR), valueParametersFollow));
|
||||||
|
|
||||||
|
|
||||||
parseValueParameterList(false, valueParametersFollow);
|
parseValueParameterList(false, valueParametersFollow);
|
||||||
|
|
||||||
if (at(COLON)) {
|
if (at(COLON)) {
|
||||||
@@ -874,11 +887,13 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
public void parseBlock() {
|
public void parseBlock() {
|
||||||
PsiBuilder.Marker block = mark();
|
PsiBuilder.Marker block = mark();
|
||||||
|
|
||||||
|
myBuilder.enableEols();
|
||||||
expect(LBRACE, "Expecting '{' to open a block");
|
expect(LBRACE, "Expecting '{' to open a block");
|
||||||
|
|
||||||
myExpressionParsing.parseExpressions();
|
myExpressionParsing.parseExpressions();
|
||||||
|
|
||||||
expect(RBRACE, "Expecting '}");
|
expect(RBRACE, "Expecting '}");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
block.done(BLOCK);
|
block.done(BLOCK);
|
||||||
}
|
}
|
||||||
@@ -981,6 +996,8 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
private void parsePrimaryConstructorParameterList() {
|
private void parsePrimaryConstructorParameterList() {
|
||||||
assert at(LPAR);
|
assert at(LPAR);
|
||||||
PsiBuilder.Marker cons = mark();
|
PsiBuilder.Marker cons = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
advance(); // LPAR
|
advance(); // LPAR
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -990,6 +1007,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(RPAR, "')' expected");
|
expect(RPAR, "')' expected");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
cons.done(PRIMARY_CONSTRUCTOR_PARAMETERS_LIST);
|
cons.done(PRIMARY_CONSTRUCTOR_PARAMETERS_LIST);
|
||||||
}
|
}
|
||||||
@@ -1047,6 +1065,8 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
private void parseTypeParameterList(TokenSet recoverySet) {
|
private void parseTypeParameterList(TokenSet recoverySet) {
|
||||||
PsiBuilder.Marker list = mark();
|
PsiBuilder.Marker list = mark();
|
||||||
if (at(LT)) {
|
if (at(LT)) {
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
advance(); // LT
|
advance(); // LT
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -1058,6 +1078,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(GT, "Missing '>'", recoverySet);
|
expect(GT, "Missing '>'", recoverySet);
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
if (at(WHERE_KEYWORD)) {
|
if (at(WHERE_KEYWORD)) {
|
||||||
parseTypeConstraintList();
|
parseTypeConstraintList();
|
||||||
@@ -1199,6 +1220,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
PsiBuilder.Marker list = mark();
|
PsiBuilder.Marker list = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
advance(); // LT
|
advance(); // LT
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -1209,6 +1231,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(GT, "Expecting a '>'");
|
expect(GT, "Expecting a '>'");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
list.done(TYPE_ARGUMENT_LIST);
|
list.done(TYPE_ARGUMENT_LIST);
|
||||||
}
|
}
|
||||||
@@ -1224,6 +1247,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
PsiBuilder.Marker tuple = mark();
|
PsiBuilder.Marker tuple = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
advance(); // LPAR
|
advance(); // LPAR
|
||||||
|
|
||||||
if (!at(RPAR)) {
|
if (!at(RPAR)) {
|
||||||
@@ -1252,6 +1276,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(RPAR, "Expecting ')");
|
expect(RPAR, "Expecting ')");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
tuple.done(TUPLE_TYPE);
|
tuple.done(TUPLE_TYPE);
|
||||||
}
|
}
|
||||||
@@ -1266,6 +1291,7 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
PsiBuilder.Marker functionType = mark();
|
PsiBuilder.Marker functionType = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
advance(); // LBRACE
|
advance(); // LBRACE
|
||||||
|
|
||||||
int lastLPar = findLastBefore(TokenSet.create(LPAR), TokenSet.create(RBRACE, COLON), false);
|
int lastLPar = findLastBefore(TokenSet.create(LPAR), TokenSet.create(RBRACE, COLON), false);
|
||||||
@@ -1280,6 +1306,8 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
parseFunctionTypeContents();
|
parseFunctionTypeContents();
|
||||||
|
|
||||||
expect(RBRACE, "Expecting '}");
|
expect(RBRACE, "Expecting '}");
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
functionType.done(FUNCTION_TYPE);
|
functionType.done(FUNCTION_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1311,6 +1339,8 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
*/
|
*/
|
||||||
public void parseValueParameterList(boolean isFunctionTypeContents, TokenSet recoverySet) {
|
public void parseValueParameterList(boolean isFunctionTypeContents, TokenSet recoverySet) {
|
||||||
PsiBuilder.Marker parameters = mark();
|
PsiBuilder.Marker parameters = mark();
|
||||||
|
|
||||||
|
myBuilder.disableEols();
|
||||||
expect(LPAR, "Expecting '(", recoverySet);
|
expect(LPAR, "Expecting '(", recoverySet);
|
||||||
|
|
||||||
if (!at(RPAR)) {
|
if (!at(RPAR)) {
|
||||||
@@ -1335,6 +1365,8 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
expect(RPAR, "Expecting ')'", recoverySet);
|
expect(RPAR, "Expecting ')'", recoverySet);
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
|
||||||
parameters.done(VALUE_PARAMETER_LIST);
|
parameters.done(VALUE_PARAMETER_LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,7 @@ import com.intellij.lang.PsiBuilder;
|
|||||||
*/
|
*/
|
||||||
public interface SemanticWhitespaceAwarePsiBuilder extends PsiBuilder {
|
public interface SemanticWhitespaceAwarePsiBuilder extends PsiBuilder {
|
||||||
boolean eolInLastWhitespace();
|
boolean eolInLastWhitespace();
|
||||||
|
void disableEols();
|
||||||
|
void enableEols();
|
||||||
|
void restoreEolsState();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import com.intellij.lang.PsiBuilder;
|
|||||||
import com.intellij.lang.WhitespaceSkippedCallback;
|
import com.intellij.lang.WhitespaceSkippedCallback;
|
||||||
import com.intellij.psi.tree.IElementType;
|
import com.intellij.psi.tree.IElementType;
|
||||||
|
|
||||||
|
import java.util.Stack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author abreslav
|
* @author abreslav
|
||||||
*/
|
*/
|
||||||
@@ -23,10 +25,12 @@ public class SemanticWhitespaceAwarePsiBuilderImpl extends PsiBuilderAdapter imp
|
|||||||
};
|
};
|
||||||
|
|
||||||
private boolean myEOLInLastWhitespace;
|
private boolean myEOLInLastWhitespace;
|
||||||
|
private final Stack<Boolean> myEOLsEnabled = new Stack<Boolean>();
|
||||||
|
|
||||||
public SemanticWhitespaceAwarePsiBuilderImpl(final PsiBuilder delegate) {
|
public SemanticWhitespaceAwarePsiBuilderImpl(final PsiBuilder delegate) {
|
||||||
super(delegate);
|
super(delegate);
|
||||||
delegate.setWhitespaceSkippedCallback(myWhitespaceSkippedCallback);
|
delegate.setWhitespaceSkippedCallback(myWhitespaceSkippedCallback);
|
||||||
|
myEOLsEnabled.push(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -37,7 +41,23 @@ public class SemanticWhitespaceAwarePsiBuilderImpl extends PsiBuilderAdapter imp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean eolInLastWhitespace() {
|
public boolean eolInLastWhitespace() {
|
||||||
return myEOLInLastWhitespace || eof();
|
return myEOLsEnabled.peek() && (myEOLInLastWhitespace || eof());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disableEols() {
|
||||||
|
myEOLsEnabled.push(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableEols() {
|
||||||
|
myEOLsEnabled.push(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void restoreEolsState() {
|
||||||
|
assert myEOLsEnabled.size() > 1;
|
||||||
|
myEOLsEnabled.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Overhead
|
// TODO: Overhead
|
||||||
|
|||||||
+14
@@ -22,6 +22,20 @@ public class TruncatedSemanticWhitespaceAwarePsiBuilder extends PsiBuilderAdapte
|
|||||||
return myBuilder.eolInLastWhitespace();
|
return myBuilder.eolInLastWhitespace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disableEols() {
|
||||||
|
myBuilder.disableEols();;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableEols() {
|
||||||
|
myBuilder.enableEols();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void restoreEolsState() {
|
||||||
|
myBuilder.restoreEolsState();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean eof() {
|
public boolean eof() {
|
||||||
|
|||||||
@@ -66,13 +66,72 @@ fun a(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (val x in foo) a
|
for (val x in foo) a
|
||||||
for (x in foo) a
|
for (x in foo) a
|
||||||
for (val x : Int in foo) a
|
for (val x : Int in foo) a
|
||||||
for (x : Int in foo) {}
|
for (x : Int in foo) {}
|
||||||
|
|
||||||
while (true) {}
|
while (true) {}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
|
fun foo() {
|
||||||
|
for (a in b)
|
||||||
|
b
|
||||||
|
|
||||||
|
for (a in b) {}
|
||||||
|
|
||||||
|
for (a in b) {
|
||||||
|
b
|
||||||
|
}
|
||||||
|
|
||||||
|
for (a in b);
|
||||||
|
b
|
||||||
|
|
||||||
|
while (a in b)
|
||||||
|
b
|
||||||
|
|
||||||
|
while (a in b) {
|
||||||
|
b
|
||||||
|
}
|
||||||
|
|
||||||
|
while (a in b);
|
||||||
|
b
|
||||||
|
|
||||||
|
while (a) {}
|
||||||
|
|
||||||
|
if (a)
|
||||||
|
b
|
||||||
|
else
|
||||||
|
c
|
||||||
|
|
||||||
|
if (a) b else c
|
||||||
|
|
||||||
|
if (a) b
|
||||||
|
else c
|
||||||
|
|
||||||
|
if (a)
|
||||||
|
b;
|
||||||
|
else
|
||||||
|
c;
|
||||||
|
|
||||||
|
if (a) b
|
||||||
|
if (a)
|
||||||
|
b
|
||||||
|
if (a)
|
||||||
|
b;
|
||||||
|
|
||||||
|
if (a) else c
|
||||||
|
if (a)
|
||||||
|
else c
|
||||||
|
if (a)
|
||||||
|
;
|
||||||
|
else c
|
||||||
|
if (a)
|
||||||
|
else ;
|
||||||
|
|
||||||
|
do while (r)
|
||||||
|
do foo while (r)
|
||||||
|
do {;;;foo;bar;;;; } while (r)
|
||||||
}
|
}
|
||||||
@@ -431,7 +431,7 @@ JetFile: ControlStructures.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
BODY
|
BODY
|
||||||
PsiElement(IDENTIFIER)('a')
|
PsiElement(IDENTIFIER)('a')
|
||||||
PsiWhiteSpace('\n ')
|
PsiWhiteSpace('\n ')
|
||||||
FOR
|
FOR
|
||||||
PsiElement(for)('for')
|
PsiElement(for)('for')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
@@ -447,7 +447,7 @@ JetFile: ControlStructures.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
BODY
|
BODY
|
||||||
PsiElement(IDENTIFIER)('a')
|
PsiElement(IDENTIFIER)('a')
|
||||||
PsiWhiteSpace('\n ')
|
PsiWhiteSpace('\n ')
|
||||||
FOR
|
FOR
|
||||||
PsiElement(for)('for')
|
PsiElement(for)('for')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
@@ -471,7 +471,7 @@ JetFile: ControlStructures.jet
|
|||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
BODY
|
BODY
|
||||||
PsiElement(IDENTIFIER)('a')
|
PsiElement(IDENTIFIER)('a')
|
||||||
PsiWhiteSpace('\n ')
|
PsiWhiteSpace('\n ')
|
||||||
FOR
|
FOR
|
||||||
PsiElement(for)('for')
|
PsiElement(for)('for')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
@@ -532,5 +532,379 @@ JetFile: ControlStructures.jet
|
|||||||
BOOLEAN_CONSTANT
|
BOOLEAN_CONSTANT
|
||||||
PsiElement(false)('false')
|
PsiElement(false)('false')
|
||||||
PsiElement(RPAR)(')')
|
PsiElement(RPAR)(')')
|
||||||
PsiWhiteSpace('\n')
|
PsiWhiteSpace('\n\n')
|
||||||
PsiElement(RBRACE)('}')
|
FUN
|
||||||
|
PsiElement(fun)('fun')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('foo')
|
||||||
|
TYPE_PARAMETER_LIST
|
||||||
|
<empty list>
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BLOCK
|
||||||
|
PsiElement(LBRACE)('{')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
FOR
|
||||||
|
PsiElement(for)('for')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
LOOP_PARAMETER
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(in)('in')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
LOOP_RANGE
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
BODY
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
FOR
|
||||||
|
PsiElement(for)('for')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
LOOP_PARAMETER
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(in)('in')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
LOOP_RANGE
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BODY
|
||||||
|
FUNCTION_LITERAL
|
||||||
|
PsiElement(LBRACE)('{')
|
||||||
|
BODY
|
||||||
|
<empty list>
|
||||||
|
PsiElement(RBRACE)('}')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
FOR
|
||||||
|
PsiElement(for)('for')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
LOOP_PARAMETER
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(in)('in')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
LOOP_RANGE
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BODY
|
||||||
|
FUNCTION_LITERAL
|
||||||
|
PsiElement(LBRACE)('{')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
BODY
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(RBRACE)('}')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
FOR
|
||||||
|
PsiElement(for)('for')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
LOOP_PARAMETER
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(in)('in')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
LOOP_RANGE
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
BODY
|
||||||
|
<empty list>
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
WHILE
|
||||||
|
PsiElement(while)('while')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
BINARY_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(in)('in')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
BODY
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
WHILE
|
||||||
|
PsiElement(while)('while')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
BINARY_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(in)('in')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BODY
|
||||||
|
FUNCTION_LITERAL
|
||||||
|
PsiElement(LBRACE)('{')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
BODY
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(RBRACE)('}')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
WHILE
|
||||||
|
PsiElement(while)('while')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
BINARY_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(in)('in')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
BODY
|
||||||
|
<empty list>
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
WHILE
|
||||||
|
PsiElement(while)('while')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BODY
|
||||||
|
FUNCTION_LITERAL
|
||||||
|
PsiElement(LBRACE)('{')
|
||||||
|
BODY
|
||||||
|
<empty list>
|
||||||
|
PsiElement(RBRACE)('}')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
THEN
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(else)('else')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
ELSE
|
||||||
|
PsiElement(IDENTIFIER)('c')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
THEN
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(else)('else')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
ELSE
|
||||||
|
PsiElement(IDENTIFIER)('c')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
THEN
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(else)('else')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
ELSE
|
||||||
|
PsiElement(IDENTIFIER)('c')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
THEN
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(else)('else')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
ELSE
|
||||||
|
PsiElement(IDENTIFIER)('c')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
THEN
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
THEN
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
THEN
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
THEN
|
||||||
|
<empty list>
|
||||||
|
PsiElement(else)('else')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
ELSE
|
||||||
|
PsiElement(IDENTIFIER)('c')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
THEN
|
||||||
|
<empty list>
|
||||||
|
PsiElement(else)('else')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
ELSE
|
||||||
|
PsiElement(IDENTIFIER)('c')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
THEN
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(else)('else')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
ELSE
|
||||||
|
PsiElement(IDENTIFIER)('c')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
IF
|
||||||
|
PsiElement(if)('if')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
THEN
|
||||||
|
<empty list>
|
||||||
|
PsiElement(else)('else')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
ELSE
|
||||||
|
<empty list>
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
DO_WHILE
|
||||||
|
PsiElement(do)('do')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(while)('while')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('r')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
DO_WHILE
|
||||||
|
PsiElement(do)('do')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BODY
|
||||||
|
PsiElement(IDENTIFIER)('foo')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(while)('while')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('r')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
DO_WHILE
|
||||||
|
PsiElement(do)('do')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BODY
|
||||||
|
FUNCTION_LITERAL
|
||||||
|
PsiElement(LBRACE)('{')
|
||||||
|
BODY
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiElement(IDENTIFIER)('foo')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiElement(IDENTIFIER)('bar')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(RBRACE)('}')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(while)('while')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
CONDITION
|
||||||
|
PsiElement(IDENTIFIER)('r')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n')
|
||||||
|
PsiElement(RBRACE)('}')
|
||||||
|
PsiErrorElement:Expecting '}
|
||||||
|
<empty list>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
fun foo() {
|
||||||
|
class foo
|
||||||
|
fun foo()
|
||||||
|
extension foo for boo
|
||||||
|
|
||||||
|
type x = t
|
||||||
|
decomposer (df)
|
||||||
|
|
||||||
|
var r
|
||||||
|
|
||||||
|
[a] var foo = 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
JetFile: EOLsOnRollback.jet
|
||||||
|
NAMESPACE
|
||||||
|
FUN
|
||||||
|
PsiElement(fun)('fun')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('foo')
|
||||||
|
TYPE_PARAMETER_LIST
|
||||||
|
<empty list>
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BLOCK
|
||||||
|
PsiElement(LBRACE)('{')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
CLASS
|
||||||
|
PsiElement(class)('class')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('foo')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
TYPE_PARAMETER_LIST
|
||||||
|
<empty list>
|
||||||
|
FUN
|
||||||
|
PsiElement(fun)('fun')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('foo')
|
||||||
|
TYPE_PARAMETER_LIST
|
||||||
|
<empty list>
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
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)('boo')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
TYPEDEF
|
||||||
|
PsiElement(type)('type')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('x')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
TYPE_PARAMETER_LIST
|
||||||
|
<empty list>
|
||||||
|
PsiElement(EQ)('=')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
TYPE_REFERENCE
|
||||||
|
USER_TYPE
|
||||||
|
PsiElement(IDENTIFIER)('t')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
DECOMPOSER
|
||||||
|
PsiElement(decomposer)('decomposer')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
DECOMPOSER_PROPERTY_LIST
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(IDENTIFIER)('df')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
PROPERTY
|
||||||
|
PsiElement(var)('var')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('r')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
PROPERTY
|
||||||
|
MODIFIER_LIST
|
||||||
|
ATTRIBUTE_ANNOTATION
|
||||||
|
PsiElement(LBRACKET)('[')
|
||||||
|
ATTRIBUTE
|
||||||
|
USER_TYPE
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiElement(RBRACKET)(']')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(var)('var')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('foo')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(EQ)('=')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
INTEGER_CONSTANT
|
||||||
|
PsiElement(INTEGER_LITERAL)('4')
|
||||||
|
PsiWhiteSpace('\n')
|
||||||
|
PsiElement(RBRACE)('}')
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
fun foo() {
|
||||||
|
val a = a + b
|
||||||
|
val a = a +
|
||||||
|
b
|
||||||
|
val a = a
|
||||||
|
+ b
|
||||||
|
val a = (a
|
||||||
|
+ b)
|
||||||
|
|
||||||
|
val a = b[c
|
||||||
|
+ d]
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
JetFile: NewlinesInParentheses.jet
|
||||||
|
NAMESPACE
|
||||||
|
FUN
|
||||||
|
PsiElement(fun)('fun')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('foo')
|
||||||
|
TYPE_PARAMETER_LIST
|
||||||
|
<empty list>
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BLOCK
|
||||||
|
PsiElement(LBRACE)('{')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PROPERTY
|
||||||
|
PsiElement(val)('val')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(EQ)('=')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BINARY_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(PLUS)('+')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PROPERTY
|
||||||
|
PsiElement(val)('val')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(EQ)('=')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
BINARY_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(PLUS)('+')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PROPERTY
|
||||||
|
PsiElement(val)('val')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(EQ)('=')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PREFIX_EXPRESSION
|
||||||
|
PsiElement(PLUS)('+')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PROPERTY
|
||||||
|
PsiElement(val)('val')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(EQ)('=')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
TUPLE
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
BINARY_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(PLUS)('+')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
|
PROPERTY
|
||||||
|
PsiElement(val)('val')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('a')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(EQ)('=')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
ARRAY_ACCESS_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('b')
|
||||||
|
INDICES
|
||||||
|
PsiElement(LBRACKET)('[')
|
||||||
|
BINARY_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('c')
|
||||||
|
PsiWhiteSpace('\n ')
|
||||||
|
PsiElement(PLUS)('+')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('d')
|
||||||
|
PsiElement(RBRACKET)(']')
|
||||||
|
PsiWhiteSpace('\n')
|
||||||
|
PsiElement(RBRACE)('}')
|
||||||
@@ -12,7 +12,7 @@ class foo {
|
|||||||
|
|
||||||
var f
|
var f
|
||||||
|
|
||||||
type foo =
|
type foo = ;
|
||||||
|
|
||||||
decomposer (a, b, c
|
decomposer (a, b, c
|
||||||
|
|
||||||
|
|||||||
@@ -74,10 +74,12 @@ JetFile: SimpleClassMembers_ERR.jet
|
|||||||
TYPE_PARAMETER_LIST
|
TYPE_PARAMETER_LIST
|
||||||
<empty list>
|
<empty list>
|
||||||
PsiElement(EQ)('=')
|
PsiElement(EQ)('=')
|
||||||
PsiWhiteSpace('\n\n ')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
TYPE_REFERENCE
|
||||||
PsiErrorElement:Type expected
|
PsiErrorElement:Type expected
|
||||||
<empty list>
|
<empty list>
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
PsiWhiteSpace('\n\n ')
|
||||||
DECOMPOSER
|
DECOMPOSER
|
||||||
PsiElement(decomposer)('decomposer')
|
PsiElement(decomposer)('decomposer')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
@@ -92,49 +94,50 @@ JetFile: SimpleClassMembers_ERR.jet
|
|||||||
PsiElement(IDENTIFIER)('c')
|
PsiElement(IDENTIFIER)('c')
|
||||||
PsiErrorElement:Expecting ',' or a closing ')'
|
PsiErrorElement:Expecting ',' or a closing ')'
|
||||||
<empty list>
|
<empty list>
|
||||||
PsiWhiteSpace('\n\n ')
|
PsiWhiteSpace('\n\n ')
|
||||||
|
PsiElement(this)('this')
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiErrorElement:Expecting member declaration
|
||||||
|
PsiElement(COLON)(':')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
CONSTRUCTOR
|
CONSTRUCTOR
|
||||||
PsiElement(this)('this')
|
PsiElement(this)('this')
|
||||||
VALUE_PARAMETER_LIST
|
VALUE_PARAMETER_LIST
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(LPAR)('(')
|
||||||
PsiElement(RPAR)(')')
|
VALUE_PARAMETER
|
||||||
PsiWhiteSpace(' ')
|
PsiElement(IDENTIFIER)('a')
|
||||||
PsiElement(COLON)(':')
|
PsiErrorElement:Parameters must have type annotation
|
||||||
PsiWhiteSpace(' ')
|
<empty list>
|
||||||
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)(',')
|
PsiElement(COMMA)(',')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
DELEGATOR_SUPER_CALL
|
VALUE_PARAMETER
|
||||||
TYPE_REFERENCE
|
PsiElement(IDENTIFIER)('b')
|
||||||
USER_TYPE
|
PsiErrorElement:Parameters must have type annotation
|
||||||
PsiElement(IDENTIFIER)('Foo')
|
<empty list>
|
||||||
TYPE_ARGUMENT_LIST
|
PsiElement(COMMA)(',')
|
||||||
PsiElement(LT)('<')
|
PsiWhiteSpace(' ')
|
||||||
TYPE_REFERENCE
|
VALUE_PARAMETER
|
||||||
USER_TYPE
|
PsiElement(IDENTIFIER)('c')
|
||||||
PsiElement(IDENTIFIER)('T')
|
PsiErrorElement:Parameters must have type annotation
|
||||||
PsiErrorElement:Expecting a '>'
|
<empty list>
|
||||||
<empty list>
|
PsiElement(RPAR)(')')
|
||||||
VALUE_ARGUMENT_LIST
|
PsiErrorElement:Expecting member declaration
|
||||||
PsiElement(LPAR)('(')
|
PsiElement(COMMA)(',')
|
||||||
VALUE_ARGUMENT
|
PsiWhiteSpace(' ')
|
||||||
PsiElement(IDENTIFIER)('bar')
|
PsiErrorElement:Expecting member declaration
|
||||||
PsiElement(RPAR)(')')
|
PsiElement(IDENTIFIER)('Foo')
|
||||||
|
PsiErrorElement:Expecting member declaration
|
||||||
|
PsiElement(LT)('<')
|
||||||
|
PsiErrorElement:Expecting member declaration
|
||||||
|
PsiElement(IDENTIFIER)('T')
|
||||||
|
PsiErrorElement:Expecting member declaration
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiErrorElement:Expecting member declaration
|
||||||
|
PsiElement(IDENTIFIER)('bar')
|
||||||
|
PsiErrorElement:Expecting member declaration
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
PsiWhiteSpace('\n\n ')
|
PsiWhiteSpace('\n\n ')
|
||||||
CONSTRUCTOR
|
CONSTRUCTOR
|
||||||
PsiElement(this)('this')
|
PsiElement(this)('this')
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class JetParsingTest extends ParsingTestCase {
|
|||||||
public void testDecomposers_ERR() throws Exception {doTest(true);}
|
public void testDecomposers_ERR() throws Exception {doTest(true);}
|
||||||
public void testEmptyFile() throws Exception {doTest(true);}
|
public void testEmptyFile() throws Exception {doTest(true);}
|
||||||
public void testEnums() throws Exception {doTest(true);}
|
public void testEnums() throws Exception {doTest(true);}
|
||||||
|
public void testEOLsOnRollback() throws Exception {doTest(true);}
|
||||||
public void testExtensions() throws Exception {doTest(true);}
|
public void testExtensions() throws Exception {doTest(true);}
|
||||||
public void testExtensions_ERR() throws Exception {doTest(true);}
|
public void testExtensions_ERR() throws Exception {doTest(true);}
|
||||||
public void testFileStart_ERR() throws Exception {doTest(true);}
|
public void testFileStart_ERR() throws Exception {doTest(true);}
|
||||||
@@ -53,6 +54,7 @@ public class JetParsingTest extends ParsingTestCase {
|
|||||||
public void testLocalDeclarations() throws Exception {doTest(true);}
|
public void testLocalDeclarations() throws Exception {doTest(true);}
|
||||||
public void testNamespaceBlock_ERR() throws Exception {doTest(true);}
|
public void testNamespaceBlock_ERR() throws Exception {doTest(true);}
|
||||||
public void testNamespaceBlock() throws Exception {doTest(true);}
|
public void testNamespaceBlock() throws Exception {doTest(true);}
|
||||||
|
public void testNewlinesInParentheses() throws Exception {doTest(true);}
|
||||||
public void testProperties() throws Exception {doTest(true);}
|
public void testProperties() throws Exception {doTest(true);}
|
||||||
public void testProperties_ERR() throws Exception {doTest(true);}
|
public void testProperties_ERR() throws Exception {doTest(true);}
|
||||||
public void testSimpleClassMembers() throws Exception {doTest(true);}
|
public void testSimpleClassMembers() throws Exception {doTest(true);}
|
||||||
|
|||||||
Reference in New Issue
Block a user