'=>' replaced with '->' in hints
This commit is contained in:
@@ -767,9 +767,9 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* whenEntry
|
* whenEntry
|
||||||
* // TODO : consider empty after =>
|
* // TODO : consider empty after ->
|
||||||
* : whenCondition{","} "=>" element SEMI
|
* : whenCondition{","} "->" element SEMI
|
||||||
* : "else" "=>" element SEMI
|
* : "else" "->" element SEMI
|
||||||
* ;
|
* ;
|
||||||
*/
|
*/
|
||||||
private void parseWhenEntry() {
|
private void parseWhenEntry() {
|
||||||
@@ -779,7 +779,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
advance(); // ELSE_KEYWORD
|
advance(); // ELSE_KEYWORD
|
||||||
|
|
||||||
if (!at(ARROW)) {
|
if (!at(ARROW)) {
|
||||||
errorUntil("Expecting '=>'", TokenSet.create(ARROW,
|
errorUntil("Expecting '->'", TokenSet.create(ARROW,
|
||||||
RBRACE, EOL_OR_SEMICOLON));
|
RBRACE, EOL_OR_SEMICOLON));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -792,7 +792,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
parseExpressionPreferringBlocks();
|
parseExpressionPreferringBlocks();
|
||||||
}
|
}
|
||||||
} else if (!atSet(WHEN_CONDITION_RECOVERY_SET)) {
|
} else if (!atSet(WHEN_CONDITION_RECOVERY_SET)) {
|
||||||
errorAndAdvance("Expecting '=>'");
|
errorAndAdvance("Expecting '->'");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parseWhenEntryNotElse();
|
parseWhenEntryNotElse();
|
||||||
@@ -803,7 +803,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* : whenCondition{","} "=>" element SEMI
|
* : whenCondition{","} "->" element SEMI
|
||||||
*/
|
*/
|
||||||
private void parseWhenEntryNotElse() {
|
private void parseWhenEntryNotElse() {
|
||||||
if (!myJetParsing.parseIdeTemplate()) {
|
if (!myJetParsing.parseIdeTemplate()) {
|
||||||
@@ -1188,7 +1188,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
// if (firstLParPos >= 0) {
|
// if (firstLParPos >= 0) {
|
||||||
// errorUntilOffset("Expecting '('", firstLParPos);
|
// errorUntilOffset("Expecting '('", firstLParPos);
|
||||||
// } else {
|
// } else {
|
||||||
// errorUntilOffset("To specify a receiver type, use the full notation: {ReceiverType.(parameters) [: ReturnType] => ...}",
|
// errorUntilOffset("To specify a receiver type, use the full notation: {ReceiverType.(parameters) [: ReturnType] -> ...}",
|
||||||
// doubleArrowPos);
|
// doubleArrowPos);
|
||||||
// dontExpectParameters = true;
|
// dontExpectParameters = true;
|
||||||
// }
|
// }
|
||||||
@@ -1203,7 +1203,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
// parseFunctionLiteralShorthandParameterList();
|
// parseFunctionLiteralShorthandParameterList();
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// expectNoAdvance(ARROW, "Expecting '=>'");
|
// expectNoAdvance(ARROW, "Expecting '->'");
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if (!paramsFound) {
|
if (!paramsFound) {
|
||||||
@@ -1258,7 +1258,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
PsiBuilder.Marker errorMarker = mark();
|
PsiBuilder.Marker errorMarker = mark();
|
||||||
advance(); // COLON
|
advance(); // COLON
|
||||||
myJetParsing.parseTypeRef();
|
myJetParsing.parseTypeRef();
|
||||||
errorMarker.error("To specify a type of a parameter or a return type, use the full notation: {(parameter : Type) : ReturnType => ...}");
|
errorMarker.error("To specify a type of a parameter or a return type, use the full notation: {(parameter : Type) : ReturnType -> ...}");
|
||||||
}
|
}
|
||||||
else if (at(ARROW)) {
|
else if (at(ARROW)) {
|
||||||
break;
|
break;
|
||||||
@@ -1505,7 +1505,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If it has no =>, it's a block, otherwise a function literal
|
* If it has no ->, it's a block, otherwise a function literal
|
||||||
*/
|
*/
|
||||||
private void parseExpressionPreferringBlocks() {
|
private void parseExpressionPreferringBlocks() {
|
||||||
if (at(LBRACE)) {
|
if (at(LBRACE)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user