Declarations are not parsed as expressions any more (JET-1)
This commit is contained in:
@@ -63,7 +63,7 @@ initializer
|
||||
;
|
||||
|
||||
block
|
||||
: "{" expressions "}"
|
||||
: "{" statements "}"
|
||||
;
|
||||
|
||||
function
|
||||
|
||||
@@ -89,7 +89,7 @@ atomicExpression
|
||||
: "typeof" "(" expression ")"
|
||||
: "new" constructorInvocation
|
||||
: objectLiteral
|
||||
: declaration
|
||||
// : declaration
|
||||
: jump
|
||||
: loop
|
||||
: SimpleName
|
||||
@@ -126,6 +126,11 @@ declaration
|
||||
: typedef
|
||||
;
|
||||
|
||||
statement
|
||||
: declaration
|
||||
: expression
|
||||
;
|
||||
|
||||
multiplicativeOperation
|
||||
: "*" : "/" : "%"
|
||||
;
|
||||
@@ -215,13 +220,13 @@ tupleLiteral // Ambiguity when after a SimpleName (infix call). In this case (e)
|
||||
;
|
||||
|
||||
functionLiteral // one can use "it" as a parameter name
|
||||
: "{" expressions "}"
|
||||
: "{" (type ".")? modifiers SimpleName "=>" expressions "}"
|
||||
: "{" (type ".")? "(" (modifiers SimpleName (":" type)?){","} ")" (":" type)? "=>" expressions "}"
|
||||
: "{" statements "}"
|
||||
: "{" (type ".")? modifiers SimpleName "=>" statements "}"
|
||||
: "{" (type ".")? "(" (modifiers SimpleName (":" type)?){","} ")" (":" type)? "=>" statements "}"
|
||||
;
|
||||
|
||||
expressions
|
||||
: SEMI* expression{SEMI+} SEMI*
|
||||
statements
|
||||
: SEMI* statement{SEMI+} SEMI*
|
||||
;
|
||||
|
||||
constructorInvocation
|
||||
|
||||
Reference in New Issue
Block a user