[PSI] Fix parse tree node
This commit is contained in:
committed by
TeamCityServer
parent
3de1566f11
commit
08e68e1887
@@ -424,7 +424,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
|||||||
PsiBuilder.Marker decl = mark();
|
PsiBuilder.Marker decl = mark();
|
||||||
|
|
||||||
if (at(CONTEXT_KEYWORD)) {
|
if (at(CONTEXT_KEYWORD)) {
|
||||||
parseContextReceiver();
|
parseContextReceiverList();
|
||||||
}
|
}
|
||||||
|
|
||||||
ModifierDetector detector = new ModifierDetector();
|
ModifierDetector detector = new ModifierDetector();
|
||||||
@@ -617,12 +617,12 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* contextReceiver
|
* contextReceiverList
|
||||||
* : "context" "(" typeReference{","}+ ")"
|
* : "context" "(" (label? typeReference{","})+ ")"
|
||||||
*/
|
*/
|
||||||
private void parseContextReceiver() {
|
private void parseContextReceiverList() {
|
||||||
assert _at(CONTEXT_KEYWORD);
|
assert _at(CONTEXT_KEYWORD);
|
||||||
PsiBuilder.Marker contextReceiver = mark();
|
PsiBuilder.Marker contextReceiverList = mark();
|
||||||
advance(); // CONTEXT_KEYWORD
|
advance(); // CONTEXT_KEYWORD
|
||||||
if (at(LPAR)) {
|
if (at(LPAR)) {
|
||||||
advance(); // LPAR
|
advance(); // LPAR
|
||||||
@@ -630,7 +630,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
|||||||
if (at(COMMA)) {
|
if (at(COMMA)) {
|
||||||
errorAndAdvance("Expecting a type reference");
|
errorAndAdvance("Expecting a type reference");
|
||||||
}
|
}
|
||||||
parseTypeRef();
|
parseContextReceiver();
|
||||||
if (at(RPAR)) {
|
if (at(RPAR)) {
|
||||||
advance();
|
advance();
|
||||||
break;
|
break;
|
||||||
@@ -644,13 +644,26 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contextReceiver.done(CONTEXT_RECEIVER);
|
contextReceiverList.done(CONTEXT_RECEIVER_LIST);
|
||||||
} else {
|
} else {
|
||||||
errorWithRecovery("Expecting context receivers", TokenSet.EMPTY);
|
errorWithRecovery("Expecting context receivers", TokenSet.EMPTY);
|
||||||
contextReceiver.drop();
|
contextReceiverList.drop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* contextReceiver
|
||||||
|
* : label? typeReference
|
||||||
|
*/
|
||||||
|
private void parseContextReceiver() {
|
||||||
|
PsiBuilder.Marker contextReceiver = mark();
|
||||||
|
if (myExpressionParsing.isAtLabelDefinitionOrMissingIdentifier()) {
|
||||||
|
myExpressionParsing.parseLabelDefinition();
|
||||||
|
}
|
||||||
|
parseTypeRef();
|
||||||
|
contextReceiver.done(CONTEXT_RECEIVER);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fileAnnotationList
|
* fileAnnotationList
|
||||||
* : ("[" "file:" annotationEntry+ "]")*
|
* : ("[" "file:" annotationEntry+ "]")*
|
||||||
@@ -1218,7 +1231,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
|
|||||||
PsiBuilder.Marker decl = mark();
|
PsiBuilder.Marker decl = mark();
|
||||||
|
|
||||||
if (at(CONTEXT_KEYWORD)) {
|
if (at(CONTEXT_KEYWORD)) {
|
||||||
parseContextReceiver();
|
parseContextReceiverList();
|
||||||
}
|
}
|
||||||
|
|
||||||
ModifierDetector detector = new ModifierDetector();
|
ModifierDetector detector = new ModifierDetector();
|
||||||
|
|||||||
Reference in New Issue
Block a user