Skip to content

Commit 2e3c42c

Browse files
authored
Merge pull request #2055 from Matejkob/lowercase-first-chart-of-child-names
Make the first character of both `name` and `deprecatedName` in every `Child` lowercase
2 parents 2d9f0a7 + 33e8107 commit 2e3c42c

14 files changed

+1033
-1033
lines changed

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift

Lines changed: 125 additions & 125 deletions
Large diffs are not rendered by default.

CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,30 @@ public let AVAILABILITY_NODES: [Node] = [
2424
traits: ["WithTrailingComma"],
2525
children: [
2626
Child(
27-
name: "Argument",
28-
deprecatedName: "Entry",
27+
name: "argument",
28+
deprecatedName: "entry",
2929
kind: .nodeChoices(choices: [
3030
Child(
31-
name: "Token",
31+
name: "token",
3232
kind: .token(
3333
choices: [.token(.binaryOperator), .token(.identifier)],
3434
requiresLeadingSpace: false,
3535
requiresTrailingSpace: false
3636
)
3737
),
3838
Child(
39-
name: "AvailabilityVersionRestriction",
39+
name: "availabilityVersionRestriction",
4040
kind: .node(kind: .platformVersion)
4141
),
4242
Child(
43-
name: "AvailabilityLabeledArgument",
43+
name: "availabilityLabeledArgument",
4444
kind: .node(kind: .availabilityLabeledArgument)
4545
),
4646
]),
4747
documentation: "The actual argument"
4848
),
4949
Child(
50-
name: "TrailingComma",
50+
name: "trailingComma",
5151
kind: .token(choices: [.token(.comma)]),
5252
documentation: "A trailing comma if the argument is followed by another argument",
5353
isOptional: true
@@ -64,7 +64,7 @@ public let AVAILABILITY_NODES: [Node] = [
6464
documentation: "An argument to an `@available` attribute that consists of a label and a value, e.g. `message: \"This has been deprecated\"`.",
6565
children: [
6666
Child(
67-
name: "Label",
67+
name: "label",
6868
kind: .token(choices: [
6969
.keyword(text: "message"),
7070
.keyword(text: "renamed"),
@@ -76,19 +76,19 @@ public let AVAILABILITY_NODES: [Node] = [
7676
documentation: "The label of the argument"
7777
),
7878
Child(
79-
name: "Colon",
79+
name: "colon",
8080
kind: .token(choices: [.token(.colon)]),
8181
documentation: "The colon separating label and value"
8282
),
8383
Child(
84-
name: "Value",
84+
name: "value",
8585
kind: .nodeChoices(choices: [
8686
Child(
87-
name: "String",
87+
name: "string",
8888
kind: .node(kind: .simpleStringLiteralExpr)
8989
),
9090
Child(
91-
name: "Version",
91+
name: "version",
9292
kind: .node(kind: .versionTuple)
9393
),
9494
]),
@@ -115,14 +115,14 @@ public let AVAILABILITY_NODES: [Node] = [
115115
documentation: "An argument to `@available` that restricts the availability on a certain platform to a version, e.g. `iOS 10` or `swift 3.4`.",
116116
children: [
117117
Child(
118-
name: "Platform",
118+
name: "platform",
119119
kind: .token(choices: [.token(.identifier)]),
120120
nameForDiagnostics: "platform",
121121
documentation:
122122
"The name of the OS on which the availability should be restricted or 'swift' if the availability should be restricted based on a Swift version."
123123
),
124124
Child(
125-
name: "Version",
125+
name: "version",
126126
kind: .node(kind: .versionTuple),
127127
nameForDiagnostics: "version",
128128
documentation: """
@@ -145,12 +145,12 @@ public let AVAILABILITY_NODES: [Node] = [
145145
documentation: "An element to represent a single component in a version, like `.1`.",
146146
children: [
147147
Child(
148-
name: "Period",
148+
name: "period",
149149
kind: .token(choices: [.token(.period)]),
150150
documentation: "The period of this version component"
151151
),
152152
Child(
153-
name: "Number",
153+
name: "number",
154154
kind: .token(choices: [.token(.integerLiteral)]),
155155
documentation: "The version number of this component"
156156
),
@@ -173,12 +173,12 @@ public let AVAILABILITY_NODES: [Node] = [
173173
documentation: "A version number like `1.2.0`. Only the first version component is required. There might be an arbitrary number of following components.",
174174
children: [
175175
Child(
176-
name: "Major",
176+
name: "major",
177177
kind: .token(choices: [.token(.integerLiteral)]),
178178
documentation: "The major version."
179179
),
180180
Child(
181-
name: "Components",
181+
name: "components",
182182
kind: .collection(kind: .versionComponentList, collectionElementName: "VersionComponent"),
183183
documentation: "Any version components that are not the major version . For example, for `1.2.0`, this will contain `.2.0`"
184184
),

CodeGeneration/Sources/SyntaxSupport/Child.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ public class Child {
214214
documentation: String? = nil,
215215
isOptional: Bool = false
216216
) {
217-
precondition(name.first?.isUppercase ?? true, "The first letter of a child’s name should be uppercase")
218-
precondition(deprecatedName?.first?.isUppercase ?? true, "The first letter of a child’s name should be uppercase")
217+
precondition(name.first?.isLowercase ?? true, "The first letter of a child’s name should be lowercase")
218+
precondition(deprecatedName?.first?.isLowercase ?? true, "The first letter of a child’s deprecatedName should be lowercase")
219219
self.name = name
220220
self.deprecatedName = deprecatedName
221221
self.kind = kind

CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ public let COMMON_NODES: [Node] = [
2828
parserFunction: "parseNonOptionalCodeBlockItem",
2929
children: [
3030
Child(
31-
name: "Item",
31+
name: "item",
3232
kind: .nodeChoices(choices: [
3333
Child(
34-
name: "Decl",
34+
name: "decl",
3535
kind: .node(kind: .decl)
3636
),
3737
Child(
38-
name: "Stmt",
38+
name: "stmt",
3939
kind: .node(kind: .stmt)
4040
),
4141
Child(
42-
name: "Expr",
42+
name: "expr",
4343
kind: .node(kind: .expr)
4444
),
4545
]),
4646
documentation: "The underlying node inside the code block."
4747
),
4848
Child(
49-
name: "Semicolon",
49+
name: "semicolon",
5050
kind: .token(choices: [.token(.semicolon)]),
5151
documentation: "If present, the trailing semicolon at the end of the item.",
5252
isOptional: true
@@ -65,16 +65,16 @@ public let COMMON_NODES: [Node] = [
6565
],
6666
children: [
6767
Child(
68-
name: "LeftBrace",
68+
name: "leftBrace",
6969
kind: .token(choices: [.token(.leftBrace)])
7070
),
7171
Child(
72-
name: "Statements",
72+
name: "statements",
7373
kind: .collection(kind: .codeBlockItemList, collectionElementName: "Statement"),
7474
nameForDiagnostics: "statements"
7575
),
7676
Child(
77-
name: "RightBrace",
77+
name: "rightBrace",
7878
kind: .token(choices: [.token(.rightBrace)])
7979
),
8080
]
@@ -90,12 +90,12 @@ public let COMMON_NODES: [Node] = [
9090
],
9191
children: [
9292
Child(
93-
name: "AsyncSpecifier",
93+
name: "asyncSpecifier",
9494
kind: .token(choices: [.keyword(text: "async")]),
9595
isOptional: true
9696
),
9797
Child(
98-
name: "ThrowsSpecifier",
98+
name: "throwsSpecifier",
9999
kind: .token(choices: [.keyword(text: "throws")]),
100100
isOptional: true
101101
),
@@ -112,12 +112,12 @@ public let COMMON_NODES: [Node] = [
112112
],
113113
children: [
114114
Child(
115-
name: "AsyncSpecifier",
115+
name: "asyncSpecifier",
116116
kind: .token(choices: [.keyword(text: "async"), .keyword(text: "reasync")]),
117117
isOptional: true
118118
),
119119
Child(
120-
name: "ThrowsSpecifier",
120+
name: "throwsSpecifier",
121121
kind: .token(choices: [.keyword(text: "throws"), .keyword(text: "rethrows")]),
122122
isOptional: true
123123
),
@@ -132,7 +132,7 @@ public let COMMON_NODES: [Node] = [
132132
traits: [],
133133
children: [
134134
Child(
135-
name: "AsyncSpecifier",
135+
name: "asyncSpecifier",
136136
kind: .token(choices: [.keyword(text: "async")]),
137137
isOptional: true
138138
)
@@ -165,17 +165,17 @@ public let COMMON_NODES: [Node] = [
165165
],
166166
children: [
167167
Child(
168-
name: "Attributes",
168+
name: "attributes",
169169
kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true),
170170
documentation: "If there were standalone attributes without a declaration to attach them to, the ``MissingDeclSyntax`` will contain these."
171171
),
172172
Child(
173-
name: "Modifiers",
173+
name: "modifiers",
174174
kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true),
175175
documentation: "If there were standalone modifiers without a declaration to attach them to, the ``MissingDeclSyntax`` will contain these."
176176
),
177177
Child(
178-
name: "Placeholder",
178+
name: "placeholder",
179179
kind: .token(choices: [.token(.identifier)], requiresLeadingSpace: false, requiresTrailingSpace: false),
180180
documentation: """
181181
A placeholder, i.e. `<#decl#>`, that can be inserted into the source code to represent the missing declaration.
@@ -196,7 +196,7 @@ public let COMMON_NODES: [Node] = [
196196
],
197197
children: [
198198
Child(
199-
name: "Placeholder",
199+
name: "placeholder",
200200
kind: .token(choices: [.token(.identifier)], requiresLeadingSpace: false, requiresTrailingSpace: false),
201201
documentation: """
202202
A placeholder, i.e. `<#expression#>`, that can be inserted into the source code to represent the missing expression.
@@ -217,7 +217,7 @@ public let COMMON_NODES: [Node] = [
217217
],
218218
children: [
219219
Child(
220-
name: "Placeholder",
220+
name: "placeholder",
221221
kind: .token(choices: [.token(.identifier)], requiresLeadingSpace: false, requiresTrailingSpace: false),
222222
documentation: """
223223
A placeholder, i.e. `<#pattern#>`, that can be inserted into the source code to represent the missing pattern.
@@ -238,7 +238,7 @@ public let COMMON_NODES: [Node] = [
238238
],
239239
children: [
240240
Child(
241-
name: "Placeholder",
241+
name: "placeholder",
242242
kind: .token(choices: [.token(.identifier)], requiresLeadingSpace: false, requiresTrailingSpace: false),
243243
documentation: """
244244
A placeholder, i.e. `<#statement#>`, that can be inserted into the source code to represent the missing pattern.
@@ -259,7 +259,7 @@ public let COMMON_NODES: [Node] = [
259259
],
260260
children: [
261261
Child(
262-
name: "Placeholder",
262+
name: "placeholder",
263263
kind: .token(choices: [.token(.identifier)], requiresLeadingSpace: false, requiresTrailingSpace: false),
264264
documentation: """
265265
A placeholder, i.e. `<#syntax#>`, that can be inserted into the source code to represent the missing pattern.
@@ -280,7 +280,7 @@ public let COMMON_NODES: [Node] = [
280280
],
281281
children: [
282282
Child(
283-
name: "Placeholder",
283+
name: "placeholder",
284284
kind: .token(choices: [.token(.identifier)], requiresLeadingSpace: false, requiresTrailingSpace: false),
285285
documentation: """
286286
A placeholder, i.e. `<#type#>`, that can be inserted into the source code to represent the missing type.
@@ -315,12 +315,12 @@ public let COMMON_NODES: [Node] = [
315315
],
316316
children: [
317317
Child(
318-
name: "AsyncSpecifier",
318+
name: "asyncSpecifier",
319319
kind: .token(choices: [.keyword(text: "async")]),
320320
isOptional: true
321321
),
322322
Child(
323-
name: "ThrowsSpecifier",
323+
name: "throwsSpecifier",
324324
kind: .token(choices: [.keyword(text: "throws")]),
325325
isOptional: true
326326
),

0 commit comments

Comments
 (0)