Skip to content

Commit 1f6beda

Browse files
authored
Merge pull request #1896 from ahoppen/ahoppen/naming-improvements
Further naming improvements for syntax node children
2 parents aa49fec + b9a3830 commit 1f6beda

File tree

92 files changed

+6891
-3089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+6891
-3089
lines changed

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public let ATTRIBUTE_NODES: [Node] = [
5555
isOptional: true
5656
),
5757
Child(
58-
name: "Argument",
58+
name: "Arguments",
59+
deprecatedName: "Argument",
5960
kind: .nodeChoices(choices: [
6061
Child(
6162
name: "ArgumentList",
@@ -456,7 +457,7 @@ public let ATTRIBUTE_NODES: [Node] = [
456457
kind: .token(choices: [.token(tokenKind: "LeftParenToken")])
457458
),
458459
Child(
459-
name: "DiffParams",
460+
name: "DifferentiabilityParameters",
460461
kind: .collection(kind: .differentiabilityParamList, collectionElementName: "DifferentiabilityParam"),
461462
documentation: "The parameters for differentiation."
462463
),
@@ -583,7 +584,8 @@ public let ATTRIBUTE_NODES: [Node] = [
583584
kind: .token(choices: [.token(tokenKind: "ColonToken")])
584585
),
585586
Child(
586-
name: "Declname",
587+
name: "DeclName",
588+
deprecatedName: "Declname",
587589
kind: .node(kind: .declName)
588590
),
589591
]
@@ -863,7 +865,8 @@ public let ATTRIBUTE_NODES: [Node] = [
863865
documentation: "The colon separating the label and the value"
864866
),
865867
Child(
866-
name: "Declname",
868+
name: "DeclName",
869+
deprecatedName: "Declname",
867870
kind: .node(kind: .declName),
868871
nameForDiagnostics: "declaration name",
869872
documentation: "The value for this argument"

CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public let DECL_NODES: [Node] = [
7979
kind: .token(choices: [.token(tokenKind: "LeftParenToken")])
8080
),
8181
Child(
82-
name: "PropertyList",
82+
name: "Properties",
83+
deprecatedName: "PropertyList",
8384
kind: .collection(kind: .tupleExprElementList, collectionElementName: "Property"),
8485
nameForDiagnostics: "properties"
8586
),
@@ -104,7 +105,8 @@ public let DECL_NODES: [Node] = [
104105
kind: .token(choices: [.token(tokenKind: "LeftParenToken")])
105106
),
106107
Child(
107-
name: "PropertyList",
108+
name: "Properties",
109+
deprecatedName: "PropertyList",
108110
kind: .collection(kind: .tupleExprElementList, collectionElementName: "Property"),
109111
nameForDiagnostics: "properties"
110112
),
@@ -240,7 +242,7 @@ public let DECL_NODES: [Node] = [
240242
nameForDiagnostics: "actor",
241243
traits: [
242244
"DeclGroup",
243-
"IdentifiedDecl",
245+
"NamedDecl",
244246
"WithAttributes",
245247
"WithGenericParameters",
246248
"WithModifiers",
@@ -263,7 +265,8 @@ public let DECL_NODES: [Node] = [
263265
kind: .token(choices: [.keyword(text: "actor")])
264266
),
265267
Child(
266-
name: "Identifier",
268+
name: "Name",
269+
deprecatedName: "Identifier",
267270
kind: .token(choices: [.token(tokenKind: "IdentifierToken")])
268271
),
269272
Child(
@@ -328,7 +331,7 @@ public let DECL_NODES: [Node] = [
328331
```
329332
""",
330333
traits: [
331-
"IdentifiedDecl",
334+
"NamedDecl",
332335
"WithAttributes",
333336
"WithModifiers",
334337
],
@@ -353,7 +356,8 @@ public let DECL_NODES: [Node] = [
353356
documentation: "The `associatedtype` keyword for this declaration."
354357
),
355358
Child(
356-
name: "Identifier",
359+
name: "Name",
360+
deprecatedName: "Identifier",
357361
kind: .token(choices: [.token(tokenKind: "IdentifierToken")]),
358362
documentation: "The name of this associated type."
359363
),
@@ -416,7 +420,7 @@ public let DECL_NODES: [Node] = [
416420
""",
417421
traits: [
418422
"DeclGroup",
419-
"IdentifiedDecl",
423+
"NamedDecl",
420424
"WithAttributes",
421425
"WithGenericParameters",
422426
"WithModifiers",
@@ -442,7 +446,8 @@ public let DECL_NODES: [Node] = [
442446
documentation: "The `class` keyword for this declaration."
443447
),
444448
Child(
445-
name: "Identifier",
449+
name: "Name",
450+
deprecatedName: "Identifier",
446451
kind: .token(choices: [.token(tokenKind: "IdentifierToken")]),
447452
documentation: "The name of the class."
448453
),
@@ -676,7 +681,8 @@ public let DECL_NODES: [Node] = [
676681
documentation: "The '(' to open the parameter clause."
677682
),
678683
Child(
679-
name: "ParameterList",
684+
name: "Parameters",
685+
deprecatedName: "ParameterList",
680686
kind: .collection(kind: .enumCaseParameterList, collectionElementName: "Parameter"),
681687
nameForDiagnostics: "parameters",
682688
documentation: "The actual parameters."
@@ -803,7 +809,8 @@ public let DECL_NODES: [Node] = [
803809
],
804810
children: [
805811
Child(
806-
name: "Identifier",
812+
name: "Name",
813+
deprecatedName: "Identifier",
807814
kind: .token(choices: [.token(tokenKind: "IdentifierToken")]),
808815
documentation: "The name of this case."
809816
),
@@ -836,7 +843,7 @@ public let DECL_NODES: [Node] = [
836843
documentation: "A Swift `enum` declaration.",
837844
traits: [
838845
"DeclGroup",
839-
"IdentifiedDecl",
846+
"NamedDecl",
840847
"WithAttributes",
841848
"WithGenericParameters",
842849
"WithModifiers",
@@ -862,7 +869,8 @@ public let DECL_NODES: [Node] = [
862869
documentation: "The `enum` keyword for this declaration."
863870
),
864871
Child(
865-
name: "Identifier",
872+
name: "Name",
873+
deprecatedName: "Identifier",
866874
kind: .token(choices: [.token(tokenKind: "IdentifierToken")]),
867875
documentation: "Declares the name of this enum. If the name matches a reserved keyword use backticks to escape it."
868876
),
@@ -958,7 +966,7 @@ public let DECL_NODES: [Node] = [
958966
base: .decl,
959967
nameForDiagnostics: "function",
960968
traits: [
961-
"IdentifiedDecl",
969+
"NamedDecl",
962970
"WithAttributes",
963971
"WithGenericParameters",
964972
"WithModifiers",
@@ -981,7 +989,8 @@ public let DECL_NODES: [Node] = [
981989
kind: .token(choices: [.keyword(text: "func")])
982990
),
983991
Child(
984-
name: "Identifier",
992+
name: "Name",
993+
deprecatedName: "Identifier",
985994
kind: .token(choices: [
986995
.token(tokenKind: "IdentifierToken"),
987996
.token(tokenKind: "BinaryOperatorToken"),
@@ -1259,7 +1268,8 @@ public let DECL_NODES: [Node] = [
12591268
],
12601269
children: [
12611270
Child(
1262-
name: "TypeName",
1271+
name: "Type",
1272+
deprecatedName: "TypeName",
12631273
kind: .node(kind: .type)
12641274
),
12651275
Child(
@@ -1370,7 +1380,7 @@ public let DECL_NODES: [Node] = [
13701380
base: .decl,
13711381
nameForDiagnostics: "macro",
13721382
traits: [
1373-
"IdentifiedDecl",
1383+
"NamedDecl",
13741384
"WithAttributes",
13751385
"WithGenericParameters",
13761386
"WithModifiers",
@@ -1393,7 +1403,8 @@ public let DECL_NODES: [Node] = [
13931403
kind: .token(choices: [.keyword(text: "macro")])
13941404
),
13951405
Child(
1396-
name: "Identifier",
1406+
name: "Name",
1407+
deprecatedName: "Identifier",
13971408
kind: .token(choices: [.token(tokenKind: "IdentifierToken")])
13981409
),
13991410
Child(
@@ -1454,7 +1465,8 @@ public let DECL_NODES: [Node] = [
14541465
documentation: "The `#` sign."
14551466
),
14561467
Child(
1457-
name: "Macro",
1468+
name: "MacroName",
1469+
deprecatedName: "Macro",
14581470
kind: .token(choices: [.token(tokenKind: "IdentifierToken")])
14591471
),
14601472
Child(
@@ -1469,7 +1481,8 @@ public let DECL_NODES: [Node] = [
14691481
isOptional: true
14701482
),
14711483
Child(
1472-
name: "ArgumentList",
1484+
name: "Arguments",
1485+
deprecatedName: "ArgumentList",
14731486
kind: .collection(kind: .tupleExprElementList, collectionElementName: "Argument")
14741487
),
14751488
Child(
@@ -1577,7 +1590,7 @@ public let DECL_NODES: [Node] = [
15771590
nameForDiagnostics: "operator declaration",
15781591
documentation: "A Swift `operator` declaration.",
15791592
traits: [
1580-
"IdentifiedDecl"
1593+
"NamedDecl"
15811594
],
15821595
children: [
15831596
Child(
@@ -1592,7 +1605,8 @@ public let DECL_NODES: [Node] = [
15921605
kind: .token(choices: [.keyword(text: "operator")])
15931606
),
15941607
Child(
1595-
name: "Identifier",
1608+
name: "Name",
1609+
deprecatedName: "Identifier",
15961610
kind: .token(choices: [.token(tokenKind: "BinaryOperatorToken"), .token(tokenKind: "PrefixOperatorToken"), .token(tokenKind: "PostfixOperatorToken")])
15971611
),
15981612
Child(
@@ -1642,7 +1656,8 @@ public let DECL_NODES: [Node] = [
16421656
kind: .token(choices: [.token(tokenKind: "LeftParenToken")])
16431657
),
16441658
Child(
1645-
name: "ParameterList",
1659+
name: "Parameters",
1660+
deprecatedName: "ParameterList",
16461661
kind: .collection(kind: .functionParameterList, collectionElementName: "Parameter"),
16471662
nameForDiagnostics: "parameters"
16481663
),
@@ -1685,7 +1700,8 @@ public let DECL_NODES: [Node] = [
16851700
isOptional: true
16861701
),
16871702
Child(
1688-
name: "Accessor",
1703+
name: "Accessors",
1704+
deprecatedName: "Accessor",
16891705
kind: .nodeChoices(choices: [
16901706
Child(
16911707
name: "Accessors",
@@ -1765,7 +1781,8 @@ public let DECL_NODES: [Node] = [
17651781
kind: .token(choices: [.token(tokenKind: "LeftParenToken")])
17661782
),
17671783
Child(
1768-
name: "Args",
1784+
name: "Arguments",
1785+
deprecatedName: "Args",
17691786
kind: .node(kind: .poundSourceLocationArgs),
17701787
nameForDiagnostics: "arguments",
17711788
isOptional: true
@@ -1848,7 +1865,7 @@ public let DECL_NODES: [Node] = [
18481865
nameForDiagnostics: "precedencegroup",
18491866
documentation: "A Swift `precedencegroup` declaration.",
18501867
traits: [
1851-
"IdentifiedDecl",
1868+
"NamedDecl",
18521869
"WithAttributes",
18531870
"WithModifiers",
18541871
],
@@ -1872,7 +1889,8 @@ public let DECL_NODES: [Node] = [
18721889
kind: .token(choices: [.keyword(text: "precedencegroup")])
18731890
),
18741891
Child(
1875-
name: "Identifier",
1892+
name: "Name",
1893+
deprecatedName: "Identifier",
18761894
kind: .token(choices: [.token(tokenKind: "IdentifierToken")]),
18771895
documentation: "The name of this precedence group."
18781896
),
@@ -1961,7 +1979,7 @@ public let DECL_NODES: [Node] = [
19611979
""",
19621980
traits: [
19631981
"DeclGroup",
1964-
"IdentifiedDecl",
1982+
"NamedDecl",
19651983
"WithAttributes",
19661984
"WithModifiers",
19671985
],
@@ -1986,7 +2004,8 @@ public let DECL_NODES: [Node] = [
19862004
documentation: "The `protocol` keyword for this declaration."
19872005
),
19882006
Child(
1989-
name: "Identifier",
2007+
name: "Name",
2008+
deprecatedName: "Identifier",
19902009
kind: .token(choices: [.token(tokenKind: "IdentifierToken")]),
19912010
documentation: "The name of the protocol."
19922011
),
@@ -2031,7 +2050,8 @@ public let DECL_NODES: [Node] = [
20312050
kind: .token(choices: [.token(tokenKind: "ArrowToken")])
20322051
),
20332052
Child(
2034-
name: "ReturnType",
2053+
name: "Type",
2054+
deprecatedName: "ReturnType",
20352055
kind: .node(kind: .type),
20362056
nameForDiagnostics: "return type"
20372057
),
@@ -2128,7 +2148,7 @@ public let DECL_NODES: [Node] = [
21282148
""",
21292149
traits: [
21302150
"DeclGroup",
2131-
"IdentifiedDecl",
2151+
"NamedDecl",
21322152
"WithAttributes",
21332153
"WithGenericParameters",
21342154
"WithModifiers",
@@ -2154,7 +2174,8 @@ public let DECL_NODES: [Node] = [
21542174
documentation: "The `struct` keyword for this declaration."
21552175
),
21562176
Child(
2157-
name: "Identifier",
2177+
name: "Name",
2178+
deprecatedName: "Identifier",
21582179
kind: .token(choices: [.token(tokenKind: "IdentifierToken")]),
21592180
documentation: "Declares the name of this struct. If the name matches a reserved keyword use backticks to escape it."
21602181
),
@@ -2239,7 +2260,8 @@ public let DECL_NODES: [Node] = [
22392260
isOptional: true
22402261
),
22412262
Child(
2242-
name: "Accessor",
2263+
name: "Accessors",
2264+
deprecatedName: "Accessor",
22432265
kind: .nodeChoices(choices: [
22442266
Child(
22452267
name: "Accessors",
@@ -2266,7 +2288,8 @@ public let DECL_NODES: [Node] = [
22662288
kind: .token(choices: [.token(tokenKind: "ColonToken")])
22672289
),
22682290
Child(
2269-
name: "InheritedTypeCollection",
2291+
name: "InheritedTypes",
2292+
deprecatedName: "InheritedTypeCollection",
22702293
kind: .collection(kind: .inheritedTypeList, collectionElementName: "InheritedType")
22712294
),
22722295
]
@@ -2299,7 +2322,7 @@ public let DECL_NODES: [Node] = [
22992322
base: .decl,
23002323
nameForDiagnostics: "typealias declaration",
23012324
traits: [
2302-
"IdentifiedDecl",
2325+
"NamedDecl",
23032326
"WithAttributes",
23042327
"WithGenericParameters",
23052328
"WithModifiers",
@@ -2322,7 +2345,8 @@ public let DECL_NODES: [Node] = [
23222345
kind: .token(choices: [.keyword(text: "typealias")])
23232346
),
23242347
Child(
2325-
name: "Identifier",
2348+
name: "Name",
2349+
deprecatedName: "Identifier",
23262350
kind: .token(choices: [.token(tokenKind: "IdentifierToken")])
23272351
),
23282352
Child(

0 commit comments

Comments
 (0)