Skip to content

Commit

Permalink
KT-222 Grammar Docu of objectLiteral slightly wrong
Browse files Browse the repository at this point in the history
 #KT-222 Fixed
  • Loading branch information
abreslav committed Mar 28, 2012
1 parent 32e1018 commit 7714f84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Expand Up @@ -1859,7 +1859,10 @@ private void parseValueArgument() {
parseExpression(); parseExpression();
argument.done(VALUE_ARGUMENT); argument.done(VALUE_ARGUMENT);
} }


/*
* "object" (":" delegationSpecifier{","})? classBody // Cannot make class body optional: foo(object : F, A)
*/
public void parseObjectLiteral() { public void parseObjectLiteral() {
PsiBuilder.Marker literal = mark(); PsiBuilder.Marker literal = mark();
PsiBuilder.Marker declaration = mark(); PsiBuilder.Marker declaration = mark();
Expand Down
Expand Up @@ -1552,17 +1552,15 @@ else if (TYPE_REF_FIRST.contains(tt())) {


/* /*
* functionType * functionType
* : (type ".")? "(" (parameter | modifiers type){","} ")" "->" type? * : (type ".")? "(" (parameter | modifiers type){","}? ")" "->" type?
* ; * ;
*/ */
private void parseFunctionType() { private void parseFunctionType() {
parseFunctionTypeContents().done(FUNCTION_TYPE); parseFunctionTypeContents().done(FUNCTION_TYPE);
} }


private PsiBuilder.Marker parseFunctionTypeContents() { private PsiBuilder.Marker parseFunctionTypeContents() {
// assert _at(LPAR) : tt(); assert _at(LPAR) : tt();
if (!_at(LPAR))
System.out.println(myBuilder.getTokenText());
PsiBuilder.Marker functionType = mark(); PsiBuilder.Marker functionType = mark();


// advance(); // LPAR // advance(); // LPAR
Expand Down
2 changes: 1 addition & 1 deletion grammar/src/expressions.grm
Expand Up @@ -266,7 +266,7 @@ arrayAccess
; ;


objectLiteral objectLiteral
: "object" ":" delegationSpecifier{","}? classBody // Cannot make class body optional: foo(object : F, A) : "object" (":" delegationSpecifier{","})? classBody // Cannot make class body optional: foo(object : F, A)
; ;


/* Factory methods: /* Factory methods:
Expand Down

0 comments on commit 7714f84

Please sign in to comment.