Fix grammar docs for type aliases in AST

Closes https://github.com/dart-lang/sdk/pull/52515

GitOrigin-RevId: aa7b3ddee2a5b90bbb671e15b9a777ae441f83b4
Change-Id: Ib201d5ef9193b50305138efc23e97b8c5be8336f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305840
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Marcin Wojnarowski 2023-06-22 21:17:52 +00:00 committed by Commit Queue
parent 951d589c20
commit e56ef707eb

View file

@ -3098,7 +3098,7 @@ abstract final class ClassOrAugmentationDeclaration
/// A class type alias.
///
/// classTypeAlias ::=
/// name [TypeParameterList]? '=' classModifiers mixinApplication
/// classModifiers 'class' [SimpleIdentifier] [TypeParameterList]? '=' mixinApplication
///
/// classModifiers ::= 'sealed'
/// | 'abstract'? ('base' | 'interface' | 'final')?
@ -3152,8 +3152,7 @@ abstract final class ClassTypeAlias implements TypeAlias {
/// A class type alias.
///
/// classTypeAlias ::=
/// [SimpleIdentifier] [TypeParameterList]? '=' classModifiers
/// mixinApplication
/// classModifiers 'class' [SimpleIdentifier] [TypeParameterList]? '=' mixinApplication
///
/// classModifiers ::= 'sealed'
/// | 'abstract'? ('base' | 'interface' | 'final')?
@ -8881,7 +8880,7 @@ final class FunctionReferenceImpl extends CommentReferableExpressionImpl
/// A function type alias.
///
/// functionTypeAlias ::=
/// functionPrefix [TypeParameterList]? [FormalParameterList] ';'
/// 'typedef' functionPrefix [TypeParameterList]? [FormalParameterList] ';'
///
/// functionPrefix ::=
/// [TypeAnnotation]? [SimpleIdentifier]
@ -8906,10 +8905,10 @@ abstract final class FunctionTypeAlias implements TypeAlias {
/// A function type alias.
///
/// functionTypeAlias ::=
/// functionPrefix [TypeParameterList]? [FormalParameterList] ';'
/// 'typedef' functionPrefix [TypeParameterList]? [FormalParameterList] ';'
///
/// functionPrefix ::=
/// [TypeName]? [SimpleIdentifier]
/// [TypeAnnotation]? [SimpleIdentifier]
final class FunctionTypeAliasImpl extends TypeAliasImpl
implements FunctionTypeAlias {
/// The name of the return type of the function type being defined, or `null`
@ -9302,7 +9301,7 @@ final class GenericFunctionTypeImpl extends TypeAnnotationImpl
/// A generic type alias.
///
/// functionTypeAlias ::=
/// metadata 'typedef' name [TypeParameterList]? = [FunctionType] ';'
/// 'typedef' [SimpleIdentifier] [TypeParameterList]? = [FunctionType] ';'
///
/// Clients may not extend, implement or mix-in this class.
abstract final class GenericTypeAlias implements TypeAlias {
@ -9327,8 +9326,7 @@ abstract final class GenericTypeAlias implements TypeAlias {
/// A generic type alias.
///
/// functionTypeAlias ::=
/// metadata 'typedef' [SimpleIdentifier] [TypeParameterList]? =
/// [FunctionType] ';'
/// 'typedef' [SimpleIdentifier] [TypeParameterList]? = [FunctionType] ';'
final class GenericTypeAliasImpl extends TypeAliasImpl
implements GenericTypeAlias {
/// The type being defined by the alias.
@ -18473,32 +18471,28 @@ final class TryStatementImpl extends StatementImpl implements TryStatement {
/// The declaration of a type alias.
///
/// typeAlias ::=
/// 'typedef' typeAliasBody
///
/// typeAliasBody ::=
/// classTypeAlias
/// | functionTypeAlias
/// [ClassTypeAlias]
/// | [FunctionTypeAlias]
/// | [GenericTypeAlias]
///
/// Clients may not extend, implement or mix-in this class.
abstract final class TypeAlias implements NamedCompilationUnitMember {
/// Return the semicolon terminating the declaration.
Token get semicolon;
/// Return the token representing the 'typedef' keyword.
/// Return the token representing the 'typedef' or 'class' keyword.
Token get typedefKeyword;
}
/// The declaration of a type alias.
///
/// typeAlias ::=
/// 'typedef' typeAliasBody
///
/// typeAliasBody ::=
/// classTypeAlias
/// | functionTypeAlias
/// [ClassTypeAlias]
/// | [FunctionTypeAlias]
/// | [GenericTypeAlias]
sealed class TypeAliasImpl extends NamedCompilationUnitMemberImpl
implements TypeAlias {
/// The token representing the 'typedef' keyword.
/// The token representing the 'typedef' or 'class' keyword.
@override
final Token typedefKeyword;