@@ -7470,10 +7470,13 @@ extension ObjCSelectorPieceSyntax: CustomReflectable {
7470
7470
7471
7471
///
7472
7472
/// The arguments for the `@differentiable` attribute: an optional
7473
- /// differentiability parameter clause and an optional 'where' clause.
7473
+ /// differentiability kind, an optional differentiability parameter clause,
7474
+ /// and an optional 'where' clause.
7474
7475
///
7475
7476
public struct DifferentiableAttributeArgumentsSyntax : SyntaxProtocol , SyntaxHashable {
7476
7477
enum Cursor : Int {
7478
+ case diffKind
7479
+ case diffKindComma
7477
7480
case diffParams
7478
7481
case diffParamsComma
7479
7482
case whereClause
@@ -7500,6 +7503,53 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash
7500
7503
return Swift . type ( of: self )
7501
7504
}
7502
7505
7506
+ public var diffKind : TokenSyntax ? {
7507
+ get {
7508
+ let childData = data. child ( at: Cursor . diffKind,
7509
+ parent: Syntax ( self ) )
7510
+ if childData == nil { return nil }
7511
+ return TokenSyntax ( childData!)
7512
+ }
7513
+ set ( value) {
7514
+ self = withDiffKind ( value)
7515
+ }
7516
+ }
7517
+
7518
+ /// Returns a copy of the receiver with its `diffKind` replaced.
7519
+ /// - param newChild: The new `diffKind` to replace the node's
7520
+ /// current `diffKind`, if present.
7521
+ public func withDiffKind(
7522
+ _ newChild: TokenSyntax ? ) -> DifferentiableAttributeArgumentsSyntax {
7523
+ let raw = newChild? . raw
7524
+ let newData = data. replacingChild ( raw, at: Cursor . diffKind)
7525
+ return DifferentiableAttributeArgumentsSyntax ( newData)
7526
+ }
7527
+
7528
+ ///
7529
+ /// The comma following the differentiability kind, if it exists.
7530
+ ///
7531
+ public var diffKindComma : TokenSyntax ? {
7532
+ get {
7533
+ let childData = data. child ( at: Cursor . diffKindComma,
7534
+ parent: Syntax ( self ) )
7535
+ if childData == nil { return nil }
7536
+ return TokenSyntax ( childData!)
7537
+ }
7538
+ set ( value) {
7539
+ self = withDiffKindComma ( value)
7540
+ }
7541
+ }
7542
+
7543
+ /// Returns a copy of the receiver with its `diffKindComma` replaced.
7544
+ /// - param newChild: The new `diffKindComma` to replace the node's
7545
+ /// current `diffKindComma`, if present.
7546
+ public func withDiffKindComma(
7547
+ _ newChild: TokenSyntax ? ) -> DifferentiableAttributeArgumentsSyntax {
7548
+ let raw = newChild? . raw
7549
+ let newData = data. replacingChild ( raw, at: Cursor . diffKindComma)
7550
+ return DifferentiableAttributeArgumentsSyntax ( newData)
7551
+ }
7552
+
7503
7553
public var diffParams : DifferentiabilityParamsClauseSyntax ? {
7504
7554
get {
7505
7555
let childData = data. child ( at: Cursor . diffParams,
@@ -7573,14 +7623,14 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash
7573
7623
7574
7624
public func _validateLayout( ) {
7575
7625
let rawChildren = Array ( RawSyntaxChildren ( Syntax ( self ) ) )
7576
- assert ( rawChildren. count == 3 )
7577
- // Check child #0 child is DifferentiabilityParamsClauseSyntax or missing
7626
+ assert ( rawChildren. count == 5 )
7627
+ // Check child #0 child is TokenSyntax or missing
7578
7628
if let raw = rawChildren [ 0 ] . raw {
7579
7629
let info = rawChildren [ 0 ] . syntaxInfo
7580
7630
let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
7581
7631
let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
7582
7632
let syntaxChild = Syntax ( syntaxData)
7583
- assert ( syntaxChild. is ( DifferentiabilityParamsClauseSyntax . self) )
7633
+ assert ( syntaxChild. is ( TokenSyntax . self) )
7584
7634
}
7585
7635
// Check child #1 child is TokenSyntax or missing
7586
7636
if let raw = rawChildren [ 1 ] . raw {
@@ -7590,12 +7640,28 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash
7590
7640
let syntaxChild = Syntax ( syntaxData)
7591
7641
assert ( syntaxChild. is ( TokenSyntax . self) )
7592
7642
}
7593
- // Check child #2 child is GenericWhereClauseSyntax or missing
7643
+ // Check child #2 child is DifferentiabilityParamsClauseSyntax or missing
7594
7644
if let raw = rawChildren [ 2 ] . raw {
7595
7645
let info = rawChildren [ 2 ] . syntaxInfo
7596
7646
let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
7597
7647
let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
7598
7648
let syntaxChild = Syntax ( syntaxData)
7649
+ assert ( syntaxChild. is ( DifferentiabilityParamsClauseSyntax . self) )
7650
+ }
7651
+ // Check child #3 child is TokenSyntax or missing
7652
+ if let raw = rawChildren [ 3 ] . raw {
7653
+ let info = rawChildren [ 3 ] . syntaxInfo
7654
+ let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
7655
+ let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
7656
+ let syntaxChild = Syntax ( syntaxData)
7657
+ assert ( syntaxChild. is ( TokenSyntax . self) )
7658
+ }
7659
+ // Check child #4 child is GenericWhereClauseSyntax or missing
7660
+ if let raw = rawChildren [ 4 ] . raw {
7661
+ let info = rawChildren [ 4 ] . syntaxInfo
7662
+ let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
7663
+ let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
7664
+ let syntaxChild = Syntax ( syntaxData)
7599
7665
assert ( syntaxChild. is ( GenericWhereClauseSyntax . self) )
7600
7666
}
7601
7667
}
@@ -7604,6 +7670,8 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash
7604
7670
extension DifferentiableAttributeArgumentsSyntax : CustomReflectable {
7605
7671
public var customMirror : Mirror {
7606
7672
return Mirror ( self , children: [
7673
+ " diffKind " : diffKind. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
7674
+ " diffKindComma " : diffKindComma. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
7607
7675
" diffParams " : diffParams. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
7608
7676
" diffParamsComma " : diffParamsComma. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
7609
7677
" whereClause " : whereClause. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
0 commit comments