Skip to content

Commit e56ef70

Browse files
shilangyuCommit Queue
authored andcommitted
Fix grammar docs for type aliases in AST
Closes #52515 GitOrigin-RevId: aa7b3dd Change-Id: Ib201d5ef9193b50305138efc23e97b8c5be8336f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305840 Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 951d589 commit e56ef70

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

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

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3098,7 +3098,7 @@ abstract final class ClassOrAugmentationDeclaration
30983098
/// A class type alias.
30993099
///
31003100
/// classTypeAlias ::=
3101-
/// name [TypeParameterList]? '=' classModifiers mixinApplication
3101+
/// classModifiers 'class' [SimpleIdentifier] [TypeParameterList]? '=' mixinApplication
31023102
///
31033103
/// classModifiers ::= 'sealed'
31043104
/// | 'abstract'? ('base' | 'interface' | 'final')?
@@ -3152,8 +3152,7 @@ abstract final class ClassTypeAlias implements TypeAlias {
31523152
/// A class type alias.
31533153
///
31543154
/// classTypeAlias ::=
3155-
/// [SimpleIdentifier] [TypeParameterList]? '=' classModifiers
3156-
/// mixinApplication
3155+
/// classModifiers 'class' [SimpleIdentifier] [TypeParameterList]? '=' mixinApplication
31573156
///
31583157
/// classModifiers ::= 'sealed'
31593158
/// | 'abstract'? ('base' | 'interface' | 'final')?
@@ -8881,7 +8880,7 @@ final class FunctionReferenceImpl extends CommentReferableExpressionImpl
88818880
/// A function type alias.
88828881
///
88838882
/// functionTypeAlias ::=
8884-
/// functionPrefix [TypeParameterList]? [FormalParameterList] ';'
8883+
/// 'typedef' functionPrefix [TypeParameterList]? [FormalParameterList] ';'
88858884
///
88868885
/// functionPrefix ::=
88878886
/// [TypeAnnotation]? [SimpleIdentifier]
@@ -8906,10 +8905,10 @@ abstract final class FunctionTypeAlias implements TypeAlias {
89068905
/// A function type alias.
89078906
///
89088907
/// functionTypeAlias ::=
8909-
/// functionPrefix [TypeParameterList]? [FormalParameterList] ';'
8908+
/// 'typedef' functionPrefix [TypeParameterList]? [FormalParameterList] ';'
89108909
///
89118910
/// functionPrefix ::=
8912-
/// [TypeName]? [SimpleIdentifier]
8911+
/// [TypeAnnotation]? [SimpleIdentifier]
89138912
final class FunctionTypeAliasImpl extends TypeAliasImpl
89148913
implements FunctionTypeAlias {
89158914
/// The name of the return type of the function type being defined, or `null`
@@ -9302,7 +9301,7 @@ final class GenericFunctionTypeImpl extends TypeAnnotationImpl
93029301
/// A generic type alias.
93039302
///
93049303
/// functionTypeAlias ::=
9305-
/// metadata 'typedef' name [TypeParameterList]? = [FunctionType] ';'
9304+
/// 'typedef' [SimpleIdentifier] [TypeParameterList]? = [FunctionType] ';'
93069305
///
93079306
/// Clients may not extend, implement or mix-in this class.
93089307
abstract final class GenericTypeAlias implements TypeAlias {
@@ -9327,8 +9326,7 @@ abstract final class GenericTypeAlias implements TypeAlias {
93279326
/// A generic type alias.
93289327
///
93299328
/// functionTypeAlias ::=
9330-
/// metadata 'typedef' [SimpleIdentifier] [TypeParameterList]? =
9331-
/// [FunctionType] ';'
9329+
/// 'typedef' [SimpleIdentifier] [TypeParameterList]? = [FunctionType] ';'
93329330
final class GenericTypeAliasImpl extends TypeAliasImpl
93339331
implements GenericTypeAlias {
93349332
/// The type being defined by the alias.
@@ -18473,32 +18471,28 @@ final class TryStatementImpl extends StatementImpl implements TryStatement {
1847318471
/// The declaration of a type alias.
1847418472
///
1847518473
/// typeAlias ::=
18476-
/// 'typedef' typeAliasBody
18477-
///
18478-
/// typeAliasBody ::=
18479-
/// classTypeAlias
18480-
/// | functionTypeAlias
18474+
/// [ClassTypeAlias]
18475+
/// | [FunctionTypeAlias]
18476+
/// | [GenericTypeAlias]
1848118477
///
1848218478
/// Clients may not extend, implement or mix-in this class.
1848318479
abstract final class TypeAlias implements NamedCompilationUnitMember {
1848418480
/// Return the semicolon terminating the declaration.
1848518481
Token get semicolon;
1848618482

18487-
/// Return the token representing the 'typedef' keyword.
18483+
/// Return the token representing the 'typedef' or 'class' keyword.
1848818484
Token get typedefKeyword;
1848918485
}
1849018486

1849118487
/// The declaration of a type alias.
1849218488
///
1849318489
/// typeAlias ::=
18494-
/// 'typedef' typeAliasBody
18495-
///
18496-
/// typeAliasBody ::=
18497-
/// classTypeAlias
18498-
/// | functionTypeAlias
18490+
/// [ClassTypeAlias]
18491+
/// | [FunctionTypeAlias]
18492+
/// | [GenericTypeAlias]
1849918493
sealed class TypeAliasImpl extends NamedCompilationUnitMemberImpl
1850018494
implements TypeAlias {
18501-
/// The token representing the 'typedef' keyword.
18495+
/// The token representing the 'typedef' or 'class' keyword.
1850218496
@override
1850318497
final Token typedefKeyword;
1850418498

0 commit comments

Comments
 (0)