@@ -1204,7 +1204,7 @@ public struct TuplePatternElementSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy
12041204/// ### Examples
12051205///
12061206/// ``TuplePatternSyntax`` can be used in more complex variable declarations.
1207- /// For example `(x, y)` in the exmaple :
1207+ /// For example `(x, y)` in the example :
12081208///
12091209/// ```swift
12101210/// let (x, y) = (1, 2)
@@ -2159,7 +2159,6 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl
21592159/// - ``MatchingPatternConditionSyntax``.``MatchingPatternConditionSyntax/typeAnnotation``
21602160/// - ``OptionalBindingConditionSyntax``.``OptionalBindingConditionSyntax/typeAnnotation``
21612161/// - ``PatternBindingSyntax``.``PatternBindingSyntax/typeAnnotation``
2162- /// - ``WildcardPatternSyntax``.``WildcardPatternSyntax/typeAnnotation``
21632162public struct TypeAnnotationSyntax : SyntaxProtocol , SyntaxHashable , _LeafSyntaxNodeProtocol {
21642163 public let _syntaxNode : Syntax
21652164
@@ -4242,17 +4241,18 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt
42424241///
42434242/// ### Examples
42444243///
4245- /// ``TuplePatternSyntax `` can be used in a simple variable declarations .
4246- /// For example `_` in the exmaple :
4244+ /// ``WildcardPattern `` matches and ignores any value .
4245+ /// For example `_` in the example :
42474246///
42484247/// ```swift
4249- /// let _: Int = (1, 2)
4248+ /// for _ in 1...3 {
4249+ /// // ...
4250+ /// }
42504251/// ```
42514252///
42524253/// ### Children
42534254///
42544255/// - `wildcard`: `_`
4255- /// - `typeAnnotation`: ``TypeAnnotationSyntax``?
42564256public struct WildcardPatternSyntax : PatternSyntaxProtocol , SyntaxHashable , _LeafPatternSyntaxNodeProtocol {
42574257 public let _syntaxNode : Syntax
42584258
@@ -4265,34 +4265,19 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea
42654265
42664266 /// - Parameters:
42674267 /// - leadingTrivia: Trivia to be prepended to the leading trivia of the node’s first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
4268- /// - typeAnnotation: The type of the pattern.
42694268 /// - trailingTrivia: Trivia to be appended to the trailing trivia of the node’s last token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
42704269 public init (
42714270 leadingTrivia: Trivia ? = nil ,
42724271 _ unexpectedBeforeWildcard: UnexpectedNodesSyntax ? = nil ,
42734272 wildcard: TokenSyntax = . wildcardToken( ) ,
4274- _ unexpectedBetweenWildcardAndTypeAnnotation: UnexpectedNodesSyntax ? = nil ,
4275- typeAnnotation: TypeAnnotationSyntax ? = nil ,
4276- _ unexpectedAfterTypeAnnotation: UnexpectedNodesSyntax ? = nil ,
4273+ _ unexpectedAfterWildcard: UnexpectedNodesSyntax ? = nil ,
42774274 trailingTrivia: Trivia ? = nil
42784275
42794276 ) {
42804277 // Extend the lifetime of all parameters so their arenas don't get destroyed
42814278 // before they can be added as children of the new arena.
4282- self = withExtendedLifetime ( ( SyntaxArena ( ) , (
4283- unexpectedBeforeWildcard,
4284- wildcard,
4285- unexpectedBetweenWildcardAndTypeAnnotation,
4286- typeAnnotation,
4287- unexpectedAfterTypeAnnotation
4288- ) ) ) { ( arena, _) in
4289- let layout : [ RawSyntax ? ] = [
4290- unexpectedBeforeWildcard? . raw,
4291- wildcard. raw,
4292- unexpectedBetweenWildcardAndTypeAnnotation? . raw,
4293- typeAnnotation? . raw,
4294- unexpectedAfterTypeAnnotation? . raw
4295- ]
4279+ self = withExtendedLifetime ( ( SyntaxArena ( ) , ( unexpectedBeforeWildcard, wildcard, unexpectedAfterWildcard) ) ) { ( arena, _) in
4280+ let layout : [ RawSyntax ? ] = [ unexpectedBeforeWildcard? . raw, wildcard. raw, unexpectedAfterWildcard? . raw]
42964281 let raw = RawSyntax . makeLayout (
42974282 kind: SyntaxKind . wildcardPattern,
42984283 from: layout,
@@ -4326,7 +4311,7 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea
43264311 }
43274312 }
43284313
4329- public var unexpectedBetweenWildcardAndTypeAnnotation : UnexpectedNodesSyntax ? {
4314+ public var unexpectedAfterWildcard : UnexpectedNodesSyntax ? {
43304315 get {
43314316 return Syntax ( self ) . child ( at: 2 ) ? . cast ( UnexpectedNodesSyntax . self)
43324317 }
@@ -4335,33 +4320,8 @@ public struct WildcardPatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _Lea
43354320 }
43364321 }
43374322
4338- /// The type of the pattern.
4339- public var typeAnnotation : TypeAnnotationSyntax ? {
4340- get {
4341- return Syntax ( self ) . child ( at: 3 ) ? . cast ( TypeAnnotationSyntax . self)
4342- }
4343- set ( value) {
4344- self = Syntax ( self ) . replacingChild ( at: 3 , with: Syntax ( value) , arena: SyntaxArena ( ) ) . cast ( WildcardPatternSyntax . self)
4345- }
4346- }
4347-
4348- public var unexpectedAfterTypeAnnotation : UnexpectedNodesSyntax ? {
4349- get {
4350- return Syntax ( self ) . child ( at: 4 ) ? . cast ( UnexpectedNodesSyntax . self)
4351- }
4352- set ( value) {
4353- self = Syntax ( self ) . replacingChild ( at: 4 , with: Syntax ( value) , arena: SyntaxArena ( ) ) . cast ( WildcardPatternSyntax . self)
4354- }
4355- }
4356-
43574323 public static var structure : SyntaxNodeStructure {
4358- return . layout( [
4359- \Self . unexpectedBeforeWildcard,
4360- \Self . wildcard,
4361- \Self . unexpectedBetweenWildcardAndTypeAnnotation,
4362- \Self . typeAnnotation,
4363- \Self . unexpectedAfterTypeAnnotation
4364- ] )
4324+ return . layout( [ \Self . unexpectedBeforeWildcard, \Self . wildcard, \Self . unexpectedAfterWildcard] )
43654325 }
43664326}
43674327
0 commit comments