Skip to content

Commit bc189ce

Browse files
authored
Merge pull request #2302 from KarolinaGroszewska/main
Add in documentation for AttributeNodes
2 parents 75969e5 + 7468960 commit bc189ce

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ public let ATTRIBUTE_NODES: [Node] = [
203203
Child(
204204
name: "platformVersion",
205205
deprecatedName: "availabilityVersionRestriction",
206-
kind: .node(kind: .platformVersion)
206+
kind: .node(kind: .platformVersion),
207+
documentation: "The platform/version pair, e.g. `iOS 10.1`"
207208
),
208209
Child(
209210
name: "trailingComma",
@@ -292,15 +293,19 @@ public let ATTRIBUTE_NODES: [Node] = [
292293
children: [
293294
Child(
294295
name: "witnessMethodLabel",
295-
kind: .token(choices: [.keyword(.witness_method)])
296+
kind: .token(choices: [.keyword(.witness_method)]),
297+
documentation: #"The `witnessMethod` label."#
296298
),
297299
Child(
298300
name: "colon",
299-
kind: .token(choices: [.token(.colon)])
301+
kind: .token(choices: [.token(.colon)]),
302+
documentation: #"The colon separating the `witnessMethod` label and the original protocol name."#
303+
300304
),
301305
Child(
302306
name: "protocolName",
303-
kind: .token(choices: [.token(.identifier)])
307+
kind: .token(choices: [.token(.identifier)]),
308+
documentation: "The original protocol name."
304309
),
305310
]
306311
),
@@ -454,6 +459,7 @@ public let ATTRIBUTE_NODES: [Node] = [
454459
name: "kindSpecifier",
455460
deprecatedName: "diffKind",
456461
kind: .token(choices: [.keyword(._forward), .keyword(.reverse), .keyword(._linear)]),
462+
documentation: "The differentiability kind, if it exists.",
457463
isOptional: true
458464
),
459465
Child(
@@ -467,6 +473,7 @@ public let ATTRIBUTE_NODES: [Node] = [
467473
name: "arguments",
468474
deprecatedName: "diffParams",
469475
kind: .node(kind: .differentiabilityWithRespectToArgument),
476+
documentation: "The differentiability arguments, if any exists.",
470477
isOptional: true
471478
),
472479
Child(
@@ -675,11 +682,13 @@ public let ATTRIBUTE_NODES: [Node] = [
675682
name: "name",
676683
kind: .node(kind: .token),
677684
nameForDiagnostics: "name",
685+
documentation: "The identifier name for a nullary selection, if it exists.",
678686
isOptional: true
679687
),
680688
Child(
681689
name: "colon",
682690
kind: .token(choices: [.token(.colon)]),
691+
documentation: "The colon separating the label and the value or a colon representing an unlabeled argument",
683692
isOptional: true
684693
),
685694
]

Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4524,6 +4524,9 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S
45244524

45254525
/// - Parameters:
45264526
/// - 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.
4527+
/// - witnessMethodLabel: The `witnessMethod` label.
4528+
/// - colon: The colon separating the `witnessMethod` label and the original protocol name.
4529+
/// - protocolName: The original protocol name.
45274530
/// - 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.
45284531
public init(
45294532
leadingTrivia: Trivia? = nil,
@@ -4578,6 +4581,8 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S
45784581
}
45794582
}
45804583

4584+
/// The `witnessMethod` label.
4585+
///
45814586
/// ### Tokens
45824587
///
45834588
/// For syntax trees generated by the parser, this is guaranteed to be `witness_method`.
@@ -4599,6 +4604,8 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S
45994604
}
46004605
}
46014606

4607+
/// The colon separating the `witnessMethod` label and the original protocol name.
4608+
///
46024609
/// ### Tokens
46034610
///
46044611
/// For syntax trees generated by the parser, this is guaranteed to be `:`.
@@ -4620,6 +4627,8 @@ public struct ConventionWitnessMethodAttributeArgumentsSyntax: SyntaxProtocol, S
46204627
}
46214628
}
46224629

4630+
/// The original protocol name.
4631+
///
46234632
/// ### Tokens
46244633
///
46254634
/// For syntax trees generated by the parser, this is guaranteed to be `<identifier>`.

Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2817,7 +2817,9 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash
28172817

28182818
/// - Parameters:
28192819
/// - 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.
2820+
/// - kindSpecifier: The differentiability kind, if it exists.
28202821
/// - kindSpecifierComma: The comma following the differentiability kind, if it exists.
2822+
/// - arguments: The differentiability arguments, if any exists.
28212823
/// - argumentsComma: The comma following the differentiability arguments clause, if it exists.
28222824
/// - genericWhereClause: A `where` clause that places additional constraints on generic parameters like `where T: Differentiable`.
28232825
/// - 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.
@@ -2886,6 +2888,8 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash
28862888
}
28872889
}
28882890

2891+
/// The differentiability kind, if it exists.
2892+
///
28892893
/// ### Tokens
28902894
///
28912895
/// For syntax trees generated by the parser, this is guaranteed to be one of the following kinds:
@@ -2933,6 +2937,7 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash
29332937
}
29342938
}
29352939

2940+
/// The differentiability arguments, if any exists.
29362941
public var arguments: DifferentiabilityWithRespectToArgumentSyntax? {
29372942
get {
29382943
return Syntax(self).child(at: 5)?.cast(DifferentiabilityWithRespectToArgumentSyntax.self)

Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt
3636

3737
/// - Parameters:
3838
/// - 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.
39+
/// - name: The identifier name for a nullary selection, if it exists.
40+
/// - colon: The colon separating the label and the value or a colon representing an unlabeled argument
3941
/// - 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.
4042
public init(
4143
leadingTrivia: Trivia? = nil,
@@ -84,6 +86,7 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt
8486
}
8587
}
8688

89+
/// The identifier name for a nullary selection, if it exists.
8790
public var name: TokenSyntax? {
8891
get {
8992
return Syntax(self).child(at: 1)?.cast(TokenSyntax.self)
@@ -102,6 +105,8 @@ public struct ObjCSelectorPieceSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt
102105
}
103106
}
104107

108+
/// The colon separating the label and the value or a colon representing an unlabeled argument
109+
///
105110
/// ### Tokens
106111
///
107112
/// For syntax trees generated by the parser, this is guaranteed to be `:`.
@@ -2101,6 +2106,7 @@ public struct PlatformVersionItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy
21012106

21022107
/// - Parameters:
21032108
/// - 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.
2109+
/// - platformVersion: The platform/version pair, e.g. `iOS 10.1`
21042110
/// - trailingComma: A trailing comma if the argument is followed by another argument
21052111
/// - 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.
21062112
public init(
@@ -2150,6 +2156,7 @@ public struct PlatformVersionItemSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy
21502156
}
21512157
}
21522158

2159+
/// The platform/version pair, e.g. `iOS 10.1`
21532160
public var platformVersion: PlatformVersionSyntax {
21542161
get {
21552162
return Syntax(self).child(at: 1)!.cast(PlatformVersionSyntax.self)

0 commit comments

Comments
 (0)