Enable augmentation of additional kinds of declaration
This CL adds support in the grammar for augmenting external top-level declarations (getter, setter, function, variable). It also adds this support to several kinds of declarations, and then factors out the `AUGMENT?` part of each alternative of `declaration` (because we are now allowing `augment` on every alternative). This CL is a continuation of https://dart-review.googlesource.com/c/sdk/+/387160 where the first batch of changes in this area were made. Change-Id: I7f02709f29d0f13010ac44c4428f90250a38948c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387221 Commit-Queue: Erik Ernst <eernst@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
+14
-14
@@ -291,10 +291,10 @@ topLevelDefinition
|
||||
| extensionDeclaration
|
||||
| enumType
|
||||
| typeAlias
|
||||
| EXTERNAL functionSignature ';'
|
||||
| EXTERNAL getterSignature ';'
|
||||
| EXTERNAL setterSignature ';'
|
||||
| EXTERNAL finalVarOrType identifierList ';'
|
||||
| AUGMENT? EXTERNAL functionSignature ';'
|
||||
| AUGMENT? EXTERNAL getterSignature ';'
|
||||
| AUGMENT? EXTERNAL setterSignature ';'
|
||||
| AUGMENT? EXTERNAL finalVarOrType identifierList ';'
|
||||
| AUGMENT? getterSignature (functionBody | ';')
|
||||
| AUGMENT? setterSignature (functionBody | ';')
|
||||
| AUGMENT? functionSignature (functionBody | ';')
|
||||
@@ -449,7 +449,7 @@ interfaces
|
||||
|
||||
classMemberDeclaration
|
||||
: AUGMENT? methodSignature functionBody
|
||||
| declaration ';'
|
||||
| AUGMENT? declaration ';'
|
||||
;
|
||||
|
||||
mixinApplicationClass
|
||||
@@ -519,15 +519,15 @@ declaration
|
||||
| EXTERNAL (STATIC? finalVarOrType | COVARIANT varOrType) identifierList
|
||||
| EXTERNAL? operatorSignature
|
||||
| ABSTRACT (finalVarOrType | COVARIANT varOrType) identifierList
|
||||
| AUGMENT? STATIC (FINAL | CONST) type? initializedIdentifierList
|
||||
| AUGMENT? STATIC LATE FINAL type? initializedIdentifierList
|
||||
| AUGMENT? STATIC LATE? varOrType initializedIdentifierList
|
||||
| AUGMENT? COVARIANT LATE FINAL type? identifierList
|
||||
| AUGMENT? COVARIANT LATE? varOrType initializedIdentifierList
|
||||
| AUGMENT? LATE? (FINAL type? | varOrType) initializedIdentifierList
|
||||
| AUGMENT? redirectingFactoryConstructorSignature
|
||||
| AUGMENT? constantConstructorSignature (redirection | initializers)?
|
||||
| AUGMENT? constructorSignature (redirection | initializers)?
|
||||
| STATIC (FINAL | CONST) type? initializedIdentifierList
|
||||
| STATIC LATE FINAL type? initializedIdentifierList
|
||||
| STATIC LATE? varOrType initializedIdentifierList
|
||||
| COVARIANT LATE FINAL type? identifierList
|
||||
| COVARIANT LATE? varOrType initializedIdentifierList
|
||||
| LATE? (FINAL type? | varOrType) initializedIdentifierList
|
||||
| redirectingFactoryConstructorSignature
|
||||
| constantConstructorSignature (redirection | initializers)?
|
||||
| constructorSignature (redirection | initializers)?
|
||||
;
|
||||
|
||||
operatorSignature
|
||||
|
||||
@@ -297,10 +297,10 @@ topLevelDefinition
|
||||
| extensionDeclaration
|
||||
| enumType
|
||||
| typeAlias
|
||||
| EXTERNAL functionSignature ';'
|
||||
| EXTERNAL getterSignature ';'
|
||||
| EXTERNAL setterSignature ';'
|
||||
| EXTERNAL finalVarOrType identifierList ';'
|
||||
| AUGMENT? EXTERNAL functionSignature ';'
|
||||
| AUGMENT? EXTERNAL getterSignature ';'
|
||||
| AUGMENT? EXTERNAL setterSignature ';'
|
||||
| AUGMENT? EXTERNAL finalVarOrType identifierList ';'
|
||||
| AUGMENT? getterSignature (functionBody | ';')
|
||||
| AUGMENT? setterSignature (functionBody | ';')
|
||||
| AUGMENT? functionSignature (functionBody | ';')
|
||||
@@ -455,7 +455,7 @@ interfaces
|
||||
|
||||
classMemberDeclaration
|
||||
: AUGMENT? methodSignature functionBody
|
||||
| declaration ';'
|
||||
| AUGMENT? declaration ';'
|
||||
;
|
||||
|
||||
mixinApplicationClass
|
||||
@@ -525,15 +525,15 @@ declaration
|
||||
| EXTERNAL (STATIC? finalVarOrType | COVARIANT varOrType) identifierList
|
||||
| EXTERNAL? operatorSignature
|
||||
| ABSTRACT (finalVarOrType | COVARIANT varOrType) identifierList
|
||||
| AUGMENT? STATIC (FINAL | CONST) type? initializedIdentifierList
|
||||
| AUGMENT? STATIC LATE FINAL type? initializedIdentifierList
|
||||
| AUGMENT? STATIC LATE? varOrType initializedIdentifierList
|
||||
| AUGMENT? COVARIANT LATE FINAL type? identifierList
|
||||
| AUGMENT? COVARIANT LATE? varOrType initializedIdentifierList
|
||||
| AUGMENT? LATE? (FINAL type? | varOrType) initializedIdentifierList
|
||||
| AUGMENT? redirectingFactoryConstructorSignature
|
||||
| AUGMENT? constantConstructorSignature (redirection | initializers)?
|
||||
| AUGMENT? constructorSignature (redirection | initializers)?
|
||||
| STATIC (FINAL | CONST) type? initializedIdentifierList
|
||||
| STATIC LATE FINAL type? initializedIdentifierList
|
||||
| STATIC LATE? varOrType initializedIdentifierList
|
||||
| COVARIANT LATE FINAL type? identifierList
|
||||
| COVARIANT LATE? varOrType initializedIdentifierList
|
||||
| LATE? (FINAL type? | varOrType) initializedIdentifierList
|
||||
| redirectingFactoryConstructorSignature
|
||||
| constantConstructorSignature (redirection | initializers)?
|
||||
| constructorSignature (redirection | initializers)?
|
||||
;
|
||||
|
||||
operatorSignature
|
||||
|
||||
Reference in New Issue
Block a user