diff --git a/grammar/src/class.grm b/grammar/src/class.grm index 4b161ccacc6..02353c87085 100644 --- a/grammar/src/class.grm +++ b/grammar/src/class.grm @@ -15,7 +15,7 @@ internal class Example>(protected val x : Foo, y : So */ class - : modifiers ("class" | "trait") SimpleName + : modifiers ("class" | "interface") SimpleName typeParameters? primaryConstructor? (":" annotations delegationSpecifier{","})? @@ -63,7 +63,6 @@ typeConstraints typeConstraint : annotations SimpleName ":" type - : annotations "class" "object" SimpleName ":" type ; /** See [Generic constraints](generics.html#generic-constraints) diff --git a/grammar/src/class_members.grm b/grammar/src/class_members.grm index 11b71e86fed..a89d3128caf 100644 --- a/grammar/src/class_members.grm +++ b/grammar/src/class_members.grm @@ -39,11 +39,10 @@ memberDeclaration anonymousInitializer : "init" block - : block ; companionObject - : modifiers "class" object + : modifiers "companion" "object" ; valueParameters diff --git a/grammar/src/control.grm b/grammar/src/control.grm index 163f37c39c9..07391728509 100644 --- a/grammar/src/control.grm +++ b/grammar/src/control.grm @@ -27,7 +27,7 @@ loop ; for - : "for" "(" annotations ("val" | "var")? (multipleVariableDeclarations | variableDeclarationEntry) "in" expression ")" expression + : "for" "(" annotations (multipleVariableDeclarations | variableDeclarationEntry) "in" expression ")" expression ; while diff --git a/grammar/src/enum.grm b/grammar/src/enum.grm index ca872153b6b..d4e817cdb67 100644 --- a/grammar/src/enum.grm +++ b/grammar/src/enum.grm @@ -5,7 +5,7 @@ See [Enum classes](enum-classes.html) */ enumClassBody - : "{" enumEntries members "}" + : "{" enumEntries (";" members)? "}" ; enumEntries diff --git a/grammar/src/expressions.grm b/grammar/src/expressions.grm index 190d74ae360..5fe20aee6bb 100644 --- a/grammar/src/expressions.grm +++ b/grammar/src/expressions.grm @@ -167,7 +167,7 @@ declaration : function : property : class - : typeAlias +// : typeAlias : object ; @@ -289,3 +289,4 @@ objectLiteralMember factoryMethod : accessModifier? SimpleName typeParameters? functionParameters functionBody ; +*/ diff --git a/grammar/src/modifiers.grm b/grammar/src/modifiers.grm index ba1f4d6967e..85b3a6d9999 100644 --- a/grammar/src/modifiers.grm +++ b/grammar/src/modifiers.grm @@ -15,7 +15,6 @@ modifierKeyword : accessModifier : varianceAnnotation : memberModifier - : parameterKind : annotations ; @@ -24,7 +23,7 @@ classModifier : "final" : "enum" : "open" - : "attribute" + : "annotation" ; memberModifier @@ -45,9 +44,3 @@ varianceAnnotation : "in" : "out" ; - -parameterKind - : "lazy" - : "out" - : "ref" - ; \ No newline at end of file diff --git a/grammar/src/toplevel.grm b/grammar/src/toplevel.grm index 920ece53cd9..bc870c23879 100644 --- a/grammar/src/toplevel.grm +++ b/grammar/src/toplevel.grm @@ -45,7 +45,7 @@ toplevelObject : object : function : property - : typeAlias +// : typeAlias ; package @@ -59,6 +59,8 @@ package See [Packages](packages.html) */ +/* typeAlias : modifiers "typealias" SimpleName (typeParameters typeConstraints)? "=" type ; +*/ diff --git a/grammar/src/types.grm b/grammar/src/types.grm index 2d4dde5247d..9715cd466d6 100644 --- a/grammar/src/types.grm +++ b/grammar/src/types.grm @@ -19,7 +19,7 @@ type // IF YOU CHANGE THIS, please, update TYPE_FIRST in JetParsing typeDescriptor : "(" typeDescriptor ")" - : selfType +// : selfType : functionType : userType : nullableType @@ -29,9 +29,11 @@ typeDescriptor nullableType : typeDescriptor "?" +/* selfType : "This" ; +*/ userType : ("package" ".")? simpleUserType{"."} diff --git a/grammar/src/when.grm b/grammar/src/when.grm index 121f458338f..4849d4b9829 100644 --- a/grammar/src/when.grm +++ b/grammar/src/when.grm @@ -5,7 +5,7 @@ See [When-expression](control-flow.html#when-expression) */ when - : "when" ("(" (modifiers "val" SimpleName "=")? expression ")")? "{" + : "when" ("(" expression ")")? "{" whenEntry* "}" ;