A few more basic expressions, some bits about newlines

This commit is contained in:
Andrey Breslav
2010-12-27 20:12:31 +03:00
parent 28696f9d60
commit 0f852ed88f
11 changed files with 311 additions and 275 deletions
+3 -3
View File
@@ -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
+2 -3
View File
@@ -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:
+1 -1
View File
@@ -11,7 +11,7 @@ preamble
;
namespaceHeader
: "namespace" SimpleName{"."}
: "namespace" SimpleName{"."} SEMI?
;
import