Skip to content

Commit ebfa2af

Browse files
committed
Generate all token choices for Swift
1 parent a1161f1 commit ebfa2af

File tree

10 files changed

+1308
-311
lines changed

10 files changed

+1308
-311
lines changed

Sources/SwiftSyntaxBuilderGeneration/gyb_generated/AttributeNodes.swift

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

Sources/SwiftSyntaxBuilderGeneration/gyb_generated/AvailabilityNodes.swift

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ let AVAILABILITY_NODES: [Node] = [
2727
nodeChoices: [
2828
Child(name: "Star",
2929
kind: "SpacedBinaryOperatorToken",
30+
tokenChoices: [
31+
"SpacedBinaryOperator"
32+
],
3033
textChoices: [
3134
"*"
3235
]),
3336
Child(name: "IdentifierRestriction",
34-
kind: "IdentifierToken"),
37+
kind: "IdentifierToken",
38+
tokenChoices: [
39+
"Identifier"
40+
]),
3541
Child(name: "AvailabilityVersionRestriction",
3642
kind: "AvailabilityVersionRestriction"),
3743
Child(name: "AvailabilityLabeledArgument",
@@ -40,7 +46,10 @@ let AVAILABILITY_NODES: [Node] = [
4046
Child(name: "TrailingComma",
4147
kind: "CommaToken",
4248
description: "A trailing comma if the argument is followed by anotherargument",
43-
isOptional: true)
49+
isOptional: true,
50+
tokenChoices: [
51+
"Comma"
52+
])
4453
]),
4554

4655
Node(name: "AvailabilityLabeledArgument",
@@ -49,16 +58,25 @@ let AVAILABILITY_NODES: [Node] = [
4958
children: [
5059
Child(name: "Label",
5160
kind: "IdentifierToken",
52-
description: "The label of the argument"),
61+
description: "The label of the argument",
62+
tokenChoices: [
63+
"Identifier"
64+
]),
5365
Child(name: "Colon",
5466
kind: "ColonToken",
55-
description: "The colon separating label and value"),
67+
description: "The colon separating label and value",
68+
tokenChoices: [
69+
"Colon"
70+
]),
5671
Child(name: "Value",
5772
kind: "Syntax",
5873
description: "The value of this labeled argument",
5974
nodeChoices: [
6075
Child(name: "String",
61-
kind: "StringLiteralToken"),
76+
kind: "StringLiteralToken",
77+
tokenChoices: [
78+
"StringLiteral"
79+
]),
6280
Child(name: "Version",
6381
kind: "VersionTuple")
6482
])
@@ -71,6 +89,9 @@ let AVAILABILITY_NODES: [Node] = [
7189
Child(name: "Platform",
7290
kind: "IdentifierToken",
7391
description: "The name of the OS on which the availability should berestricted or 'swift' if the availability should berestricted based on a Swift version.",
92+
tokenChoices: [
93+
"Identifier"
94+
],
7495
classification: "Keyword"),
7596
Child(name: "Version",
7697
kind: "VersionTuple",
@@ -86,18 +107,30 @@ let AVAILABILITY_NODES: [Node] = [
86107
description: "In case the version consists only of the major version, aninteger literal that specifies the major version. In casethe version consists of major and minor version number, afloating literal in which the decimal part is interpretedas the minor version.",
87108
nodeChoices: [
88109
Child(name: "Major",
89-
kind: "IntegerLiteralToken"),
110+
kind: "IntegerLiteralToken",
111+
tokenChoices: [
112+
"IntegerLiteral"
113+
]),
90114
Child(name: "MajorMinor",
91-
kind: "FloatingLiteralToken")
115+
kind: "FloatingLiteralToken",
116+
tokenChoices: [
117+
"FloatingLiteral"
118+
])
92119
]),
93120
Child(name: "PatchPeriod",
94121
kind: "PeriodToken",
95122
description: "If the version contains a patch number, the periodseparating the minor from the patch number.",
96-
isOptional: true),
123+
isOptional: true,
124+
tokenChoices: [
125+
"Period"
126+
]),
97127
Child(name: "PatchVersion",
98128
kind: "IntegerLiteralToken",
99129
description: "The patch version if specified.",
100-
isOptional: true)
130+
isOptional: true,
131+
tokenChoices: [
132+
"IntegerLiteral"
133+
])
101134
]),
102135

103136
]

Sources/SwiftSyntaxBuilderGeneration/gyb_generated/CommonNodes.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ let COMMON_NODES: [Node] = [
9393
Child(name: "Semicolon",
9494
kind: "SemicolonToken",
9595
description: "If present, the trailing semicolon at the end of the item.",
96-
isOptional: true),
96+
isOptional: true,
97+
tokenChoices: [
98+
"Semicolon"
99+
]),
97100
Child(name: "ErrorTokens",
98101
kind: "Syntax",
99102
isOptional: true)
@@ -113,13 +116,19 @@ let COMMON_NODES: [Node] = [
113116
],
114117
children: [
115118
Child(name: "LeftBrace",
116-
kind: "LeftBraceToken"),
119+
kind: "LeftBraceToken",
120+
tokenChoices: [
121+
"LeftBrace"
122+
]),
117123
Child(name: "Statements",
118124
kind: "CodeBlockItemList",
119125
collectionElementName: "Statement",
120126
isIndented: true),
121127
Child(name: "RightBrace",
122128
kind: "RightBraceToken",
129+
tokenChoices: [
130+
"RightBrace"
131+
],
123132
requiresLeadingNewline: true)
124133
]),
125134

0 commit comments

Comments
 (0)