Skip to content

Commit

Permalink
Rule for function literals fixed: parameter types are allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
abreslav committed Jun 2, 2016
1 parent 6ff0af1 commit 8544b9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -1040,7 +1040,7 @@ private boolean parseLocalDeclaration() {
/*
* functionLiteral // one can use "it" as a parameter name
* : "{" expressions "}"
* : "{" (modifiers SimpleName){","} "->" statements "}"
* : "{" (modifiers SimpleName (":" type)?){","} "->" statements "}"
* ;
*/
private void parseFunctionLiteral() {
Expand Down Expand Up @@ -1134,7 +1134,7 @@ else if (at(validForDrop)) {


/*
* SimpleName{,}
* (SimpleName (":" type)?){","}
*/
private void parseFunctionLiteralShorthandParameterList() {
PsiBuilder.Marker parameterList = mark();
Expand Down
2 changes: 1 addition & 1 deletion grammar/src/expressions.grm
Expand Up @@ -254,7 +254,7 @@ jump
// one can use "it" as a parameter name
functionLiteral
: "{" statements "}"
: "{" (modifiers SimpleName){","} "->" statements "}"
: "{" (modifiers SimpleName (":" type)?){","} "->" statements "}"
;

statements
Expand Down

0 comments on commit 8544b9a

Please sign in to comment.