Need references in decomposer's properties list.

This commit is contained in:
Maxim Shafirov
2011-01-09 15:19:42 +03:00
parent c0f70d0ff9
commit 9e20e81500
8 changed files with 60 additions and 30 deletions
@@ -330,10 +330,10 @@ public class JetExpressionParsing extends AbstractJetParsing {
else if (at(IDENTIFIER)) { else if (at(IDENTIFIER)) {
if (JetParsing.MODIFIER_KEYWORD_MAP.containsKey(myBuilder.getTokenText())) { if (JetParsing.MODIFIER_KEYWORD_MAP.containsKey(myBuilder.getTokenText())) {
if (!parseLocalDeclaration()) { if (!parseLocalDeclaration()) {
parseSimpleName(); parseSimpleNameExpression();
} }
} else { } else {
parseSimpleName(); parseSimpleNameExpression();
} }
} }
else if (at(LBRACE)) { else if (at(LBRACE)) {
@@ -544,7 +544,7 @@ public class JetExpressionParsing extends AbstractJetParsing {
/* /*
* SimpleName * SimpleName
*/ */
private void parseSimpleName() { public void parseSimpleNameExpression() {
PsiBuilder.Marker simpleName = mark(); PsiBuilder.Marker simpleName = mark();
expect(IDENTIFIER, "Expecting an identifier [Interal error]"); expect(IDENTIFIER, "Expecting an identifier [Interal error]");
simpleName.done(REFERENCE_EXPRESSION); simpleName.done(REFERENCE_EXPRESSION);
@@ -276,7 +276,11 @@ public class JetParsing extends AbstractJetParsing {
if (!at(RPAR)) { if (!at(RPAR)) {
while (true) { while (true) {
parseAttributeList(); parseAttributeList();
if (!expect(IDENTIFIER, "Expecting a property name", TokenSet.create(COMMA, RPAR))) { if (at(IDENTIFIER)) {
myExpressionParsing.parseSimpleNameExpression();
}
else {
errorWithRecovery("Expecting a property name", TokenSet.create(COMMA, RPAR));
skipUntil(TokenSet.create(COMMA, RPAR, EOL_OR_SEMICOLON)); skipUntil(TokenSet.create(COMMA, RPAR, EOL_OR_SEMICOLON));
} }
if (!at(COMMA)) { if (!at(COMMA)) {
+5
View File
@@ -5,9 +5,11 @@ JetFile: Decomposers.jet
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace('\n') PsiWhiteSpace('\n')
@@ -50,9 +52,11 @@ JetFile: Decomposers.jet
PsiElement(IDENTIFIER)('bar') PsiElement(IDENTIFIER)('bar')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace('\n') PsiWhiteSpace('\n')
@@ -90,6 +94,7 @@ JetFile: Decomposers.jet
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACKET)(']') PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('s') PsiElement(IDENTIFIER)('s')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace('\n') PsiWhiteSpace('\n')
+7
View File
@@ -5,6 +5,7 @@ JetFile: Decomposers_ERR.jet
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ',' or a closing ')' PsiErrorElement:Expecting ',' or a closing ')'
<empty list> <empty list>
@@ -48,6 +49,7 @@ JetFile: Decomposers_ERR.jet
<empty list> <empty list>
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace('\n') PsiWhiteSpace('\n')
@@ -86,6 +88,7 @@ JetFile: Decomposers_ERR.jet
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACKET)(']') PsiElement(RBRACKET)(']')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('s') PsiElement(IDENTIFIER)('s')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiErrorElement:Expecting a property name PsiErrorElement:Expecting a property name
@@ -114,9 +117,11 @@ JetFile: Decomposers_ERR.jet
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiErrorElement:Cannot define an extension decomposer on a tuple PsiErrorElement:Cannot define an extension decomposer on a tuple
@@ -167,9 +172,11 @@ JetFile: Decomposers_ERR.jet
PsiElement(IDENTIFIER)('bar') PsiElement(IDENTIFIER)('bar')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiErrorElement:Expecting namespace or top level declaration PsiErrorElement:Expecting namespace or top level declaration
+1
View File
@@ -61,6 +61,7 @@ JetFile: EOLsOnRollback.jet
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('df') PsiElement(IDENTIFIER)('df')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
+1
View File
@@ -153,6 +153,7 @@ JetFile: LocalDeclarations.jet
PsiElement(IDENTIFIER)('foo') PsiElement(IDENTIFIER)('foo')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar') PsiElement(IDENTIFIER)('bar')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace('\n') PsiWhiteSpace('\n')
+9
View File
@@ -93,12 +93,15 @@ JetFile: SimpleClassMembers.jet
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('c') PsiElement(IDENTIFIER)('c')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
@@ -338,12 +341,15 @@ JetFile: SimpleClassMembers.jet
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('c') PsiElement(IDENTIFIER)('c')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
@@ -433,12 +439,15 @@ JetFile: SimpleClassMembers.jet
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('c') PsiElement(IDENTIFIER)('c')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
@@ -85,12 +85,15 @@ JetFile: SimpleClassMembers_ERR.jet
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DECOMPOSER_PROPERTY_LIST DECOMPOSER_PROPERTY_LIST
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('c') PsiElement(IDENTIFIER)('c')
PsiErrorElement:Expecting ',' or a closing ')' PsiErrorElement:Expecting ',' or a closing ')'
<empty list> <empty list>