Skip to content

Commit 35ffc00

Browse files
committed
Initial draft of StructDecl node descriptions
1 parent 0f6e732 commit 35ffc00

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,6 +1813,18 @@ public let DECL_NODES: [Node] = [
18131813
Node(
18141814
name: "StructDecl",
18151815
nameForDiagnostics: "struct",
1816+
description: """
1817+
A struct declaration like the following.
1818+
1819+
```swift
1820+
struct SomeStruct {
1821+
let someMember: String
1822+
var anotherMember: Int
1823+
}
1824+
```
1825+
1826+
A struct can optionally declare no members.
1827+
""",
18161828
kind: "Decl",
18171829
traits: [
18181830
"DeclGroup",
@@ -1824,43 +1836,51 @@ public let DECL_NODES: [Node] = [
18241836
name: "Attributes",
18251837
kind: .collection(kind: "AttributeList", collectionElementName: "Attribute"),
18261838
nameForDiagnostics: "attributes",
1839+
description: "Attributes that are attached to the struct.",
18271840
isOptional: true
18281841
),
18291842
Child(
18301843
name: "Modifiers",
18311844
kind: .collection(kind: "ModifierList", collectionElementName: "Modifier"),
18321845
nameForDiagnostics: "modifiers",
1846+
description: "Modifiers that are attached to the struct.",
18331847
isOptional: true
18341848
),
18351849
Child(
18361850
name: "StructKeyword",
1837-
kind: .token(choices: [.keyword(text: "struct")])
1851+
kind: .token(choices: [.keyword(text: "struct")]),
1852+
description: "The struct keyword."
18381853
),
18391854
Child(
18401855
name: "Identifier",
1841-
kind: .token(choices: [.token(tokenKind: "IdentifierToken")])
1856+
kind: .token(choices: [.token(tokenKind: "IdentifierToken")]),
1857+
description: "The struct identifier."
18421858
),
18431859
Child(
18441860
name: "GenericParameterClause",
18451861
kind: .node(kind: "GenericParameterClause"),
18461862
nameForDiagnostics: "generic parameter clause",
1863+
description: "The generic parameters of the struct.",
18471864
isOptional: true
18481865
),
18491866
Child(
18501867
name: "InheritanceClause",
18511868
kind: .node(kind: "TypeInheritanceClause"),
18521869
nameForDiagnostics: "type inheritance clause",
1870+
description: "The inheritance clause of the struct type. This clause can contain only one or more protocols.",
18531871
isOptional: true
18541872
),
18551873
Child(
18561874
name: "GenericWhereClause",
18571875
kind: .node(kind: "GenericWhereClause"),
18581876
nameForDiagnostics: "generic where clause",
1877+
description: "The generic where clause of the struct",
18591878
isOptional: true
18601879
),
18611880
Child(
18621881
name: "MemberBlock",
1863-
kind: .node(kind: "MemberDeclBlock")
1882+
kind: .node(kind: "MemberDeclBlock"),
1883+
description: "The members of the struct. Struct extensions may declare additional members so the contents of this block should not be assumed to be the complete member list for this struct."
18641884
),
18651885
]
18661886
),

0 commit comments

Comments
 (0)