JET-126 Put 'where'-clause after the declaration

This commit is contained in:
Andrey Breslav
2011-07-08 22:44:56 +04:00
parent addfc6a421
commit c2435f0f24
13 changed files with 154 additions and 126 deletions
+5 -1
View File
@@ -21,6 +21,7 @@ class
typeParameters?
("wraps" valueParameters? | modifiers valueParameters?)?
(":" annotations delegationSpecifier{","})?
typeConstraints
(classBody? | enumClassBody)
;
@@ -40,7 +41,6 @@ explicitDelegation
typeParameters
: "<" typeParameter{","} ">"
("where" typeConstraint{","})?
;
typeParameter
@@ -51,6 +51,10 @@ typeParameter
bq. See [Generic classes|Generics#Generic classes]
*/
typeConstraints
: ("where" typeConstraint{","})?
;
typeConstraint
: annotations SimpleName ":" type
: annotations "class" "object" SimpleName ":" type
+2
View File
@@ -83,6 +83,7 @@ function
(type "." | annotations/*for receiver type*/)?
SimpleName
typeParameters? valueParameters (":" type)?
typeConstraints
functionBody?
;
@@ -95,6 +96,7 @@ property
: modifiers ("val" | "var")
typeParameters? (type "." | annotations)?
SimpleName (":" type)?
typeConstraints
("=" expression SEMI?)?
(getter? setter? | setter? getter?) SEMI?
;
+1 -1
View File
@@ -9,5 +9,5 @@ enumClassBody
;
enumEntry
: modifiers SimpleName typeParameters? valueParameters? (":" initializer{","})? classBody?
: modifiers SimpleName typeParameters? valueParameters? (":" initializer{","})? typeConstraints classBody?
;
+1 -1
View File
@@ -53,5 +53,5 @@ bq. See [Namespaces]
[undocumented]
typedef
: modifiers "type" SimpleName typeParameters? "=" type
: modifiers "type" SimpleName (typeParameters typeConstraints)? "=" type
;
+2 -2
View File
@@ -36,8 +36,8 @@ pattern
decomposerPattern
: type
// TODO : typeParameters will be consumed by the expression
: elvisExpression typeParameters? "@" tuplePattern
// TODO : typeArguments will be consumed by the expression
: elvisExpression typeArguments? "@" tuplePattern
;
constantPattern