A few more basic expressions, some bits about newlines
This commit is contained in:
@@ -67,11 +67,11 @@ initializer
|
||||
;
|
||||
|
||||
block
|
||||
: "{" (expression ";"?)* "}"
|
||||
: "{" (expression SEMI)* "}"
|
||||
;
|
||||
|
||||
decomposer // TODO: consider other names
|
||||
: modifiers "decomposer" (type ".")? SimpleName? "(" (attributes SimpleName){","}? ")" // Public properties only
|
||||
: modifiers "decomposer" (type ".")? SimpleName? "(" (attributes SimpleName){","}? ")" SEMI? // Public properties only
|
||||
;
|
||||
|
||||
function
|
||||
@@ -85,7 +85,7 @@ functionBody
|
||||
|
||||
property
|
||||
: modifiers ("val" | "var") attributes (type ".")? SimpleName (":" type)? ("=" expression)?
|
||||
(getter? setter? | setter? getter?)
|
||||
(getter? setter? | setter? getter?) SEMI?
|
||||
;
|
||||
|
||||
getter
|
||||
|
||||
@@ -158,7 +158,7 @@ functionLiteral // one can use "it" as a parameter name
|
||||
;
|
||||
|
||||
constructorInvocation
|
||||
: userType "(" expression{","} ")"
|
||||
: userType valueArguments?
|
||||
;
|
||||
|
||||
listLiteral
|
||||
@@ -193,8 +193,7 @@ arrayAccess
|
||||
;
|
||||
|
||||
objectLiteral
|
||||
: "object" delegationSpecifier{","} classBody?
|
||||
: "object" classBody
|
||||
: "object" delegationSpecifier{","}? classBody // Cannot make class body optional: foo(object F, a)
|
||||
;
|
||||
|
||||
/* Factory methods:
|
||||
|
||||
@@ -11,7 +11,7 @@ preamble
|
||||
;
|
||||
|
||||
namespaceHeader
|
||||
: "namespace" SimpleName{"."}
|
||||
: "namespace" SimpleName{"."} SEMI?
|
||||
;
|
||||
|
||||
import
|
||||
|
||||
Reference in New Issue
Block a user