Skip to content

Commit fe44e1e

Browse files
scheglovCommit Bot
authored and
Commit Bot
committed
Add MixinOrAugmentationDeclaration, MixinAugmentationDeclaration.
Change-Id: I84ddbe3d95087b8925caecc5e3d2d13b23158ab8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253363 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]>
1 parent 7bfc648 commit fe44e1e

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

pkg/analyzer/lib/dart/ast/ast.dart

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3504,20 +3504,71 @@ abstract class MethodReferenceExpression implements Expression {
35043504
MethodElement? get staticElement;
35053505
}
35063506

3507+
/// The declaration of a mixin augmentation.
3508+
///
3509+
/// mixinAugmentationDeclaration ::=
3510+
/// 'augment' 'mixin' name [TypeParameterList]?
3511+
/// [OnClause]? [ImplementsClause]? '{' [ClassMember]* '}'
3512+
///
3513+
/// Clients may not extend, implement or mix-in this class.
3514+
@experimental
3515+
abstract class MixinAugmentationDeclaration
3516+
implements MixinOrAugmentationDeclaration {
3517+
/// The token representing the 'augment' keyword.
3518+
Token get augmentKeyword;
3519+
3520+
@override
3521+
MixinAugmentationElement? get declaredElement;
3522+
}
3523+
35073524
/// The declaration of a mixin.
35083525
///
35093526
/// mixinDeclaration ::=
3510-
/// metadata? 'mixin' name [TypeParameterList]?
3527+
/// 'mixin' name [TypeParameterList]?
35113528
/// [OnClause]? [ImplementsClause]? '{' [ClassMember]* '}'
35123529
///
35133530
/// Clients may not extend, implement or mix-in this class.
3514-
abstract class MixinDeclaration implements ClassOrMixinDeclaration {
3531+
abstract class MixinDeclaration
3532+
implements MixinOrAugmentationDeclaration, ClassOrMixinDeclaration {
3533+
// TODO(scheglov) Uncomment when removed [ClassOrMixinDeclaration].
3534+
// @override
3535+
// MixinElement get declaredElement;
3536+
}
3537+
3538+
/// Shared interface between [MixinDeclaration] and
3539+
/// [MixinAugmentationDeclaration].
3540+
///
3541+
/// Clients may not extend, implement or mix-in this class.
3542+
@experimental
3543+
abstract class MixinOrAugmentationDeclaration
3544+
implements NamedCompilationUnitMember {
3545+
/// Returns the `implements` clause for the mixin, or `null` if the mixin
3546+
/// does not implement any interfaces.
3547+
ImplementsClause? get implementsClause;
3548+
3549+
// @override
3550+
// TODO(scheglov) Uncomment when removed [ClassOrMixinDeclaration].
3551+
// MixinOrAugmentationElement get declaredElement;
3552+
3553+
/// Returns the left curly bracket.
3554+
Token get leftBracket;
3555+
3556+
/// Returns the members defined by the mixin.
3557+
NodeList<ClassMember> get members;
3558+
35153559
/// Return the token representing the 'mixin' keyword.
35163560
Token get mixinKeyword;
35173561

35183562
/// Return the on clause for the mixin, or `null` if the mixin does not have
35193563
/// any superclass constraints.
35203564
OnClause? get onClause;
3565+
3566+
/// Returns the right curly bracket.
3567+
Token get rightBracket;
3568+
3569+
/// Returns the type parameters for the mixin, or `null` if the mixin does
3570+
/// not have any type parameters.
3571+
TypeParameterList? get typeParameters;
35213572
}
35223573

35233574
/// A node that declares a single name within the scope of a compilation unit.

0 commit comments

Comments
 (0)