Skip to content

Commit 58a7fe0

Browse files
committed
Remove gyb files
1 parent 658da17 commit 58a7fe0

Some content is hidden

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

54 files changed

+417
-6223
lines changed

CodeGeneration/Package.swift

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,7 @@ let package = Package(
2626
]
2727
),
2828
.target(
29-
name: "SyntaxSupport",
30-
exclude: [
31-
"gyb_helpers",
32-
"AttributeNodes.swift.gyb",
33-
"AvailabilityNodes.swift.gyb",
34-
"BuilderInitializableTypes.swift.gyb",
35-
"Classification.swift.gyb",
36-
"CommonNodes.swift.gyb",
37-
"DeclNodes.swift.gyb",
38-
"ExprNodes.swift.gyb",
39-
"GenericNodes.swift.gyb",
40-
"PatternNodes.swift.gyb",
41-
"StmtNodes.swift.gyb",
42-
"SyntaxBaseKinds.swift.gyb",
43-
"TokenSpec.swift.gyb",
44-
"Traits.swift.gyb",
45-
"Trivia.swift.gyb",
46-
"TypeNodes.swift.gyb",
47-
]
29+
name: "SyntaxSupport"
4830
),
4931
.target(
5032
name: "Utils",

CodeGeneration/Sources/SyntaxSupport/gyb_generated/AttributeNodes.swift renamed to CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
public let ATTRIBUTE_NODES: [Node] = [
16+
// attribute-list -> attribute attribute-list?
1617
Node(name: "AttributeList",
1718
nameForDiagnostics: "attributes",
1819
kind: "SyntaxCollection",
@@ -21,6 +22,16 @@ public let ATTRIBUTE_NODES: [Node] = [
2122
elementChoices: ["Attribute", "IfConfigDecl"],
2223
omitWhenEmpty: true),
2324

25+
// attribute -> '@' identifier '('?
26+
// ( identifier
27+
// | string-literal
28+
// | integer-literal
29+
// | availability-spec-list
30+
// | specialize-attr-spec-list
31+
// | implements-attr-arguments
32+
// | named-attribute-string-argument
33+
// | back-deploy-attr-spec-list
34+
// )? ')'?
2435
Node(name: "Attribute",
2536
nameForDiagnostics: "attribute",
2637
description: "An `@` attribute.",
@@ -108,6 +119,7 @@ public let ATTRIBUTE_NODES: [Node] = [
108119
kind: .token(choices: [.token(tokenKind: "SemicolonToken")]))
109120
]),
110121

122+
// back-deploy-version-entry -> availability-version-restriction ','?
111123
Node(name: "AvailabilityVersionRestrictionListEntry",
112124
nameForDiagnostics: "version",
113125
description: "A single platform/version pair in an attribute, e.g. `iOS 10.1`.",
@@ -122,11 +134,15 @@ public let ATTRIBUTE_NODES: [Node] = [
122134
isOptional: true)
123135
]),
124136

137+
// back-deploy-version-list ->
138+
// back-deploy-version-entry back-deploy-version-list?
125139
Node(name: "AvailabilityVersionRestrictionList",
126140
nameForDiagnostics: "version list",
127141
kind: "SyntaxCollection",
128142
element: "AvailabilityVersionRestrictionListEntry"),
129143

144+
// The arguments of '@backDeployed(...)'
145+
// back-deployed-attr-spec-list -> 'before' ':' back-deployed-version-list
130146
Node(name: "BackDeployedAttributeSpecList",
131147
nameForDiagnostics: "'@backDeployed' arguments",
132148
description: "A collection of arguments for the `@backDeployed` attribute",
@@ -143,6 +159,7 @@ public let ATTRIBUTE_NODES: [Node] = [
143159
description: "The list of OS versions in which the declaration became ABI stable.")
144160
]),
145161

162+
// convention-attribute-arguments -> token ',' 'cType'? ':' string-literal
146163
Node(name: "ConventionAttributeArguments",
147164
nameForDiagnostics: "@convention(...) arguments",
148165
description: "The arguments for the '@convention(...)'.",
@@ -165,6 +182,7 @@ public let ATTRIBUTE_NODES: [Node] = [
165182
isOptional: true)
166183
]),
167184

185+
// convention-attribute-arguments -> 'witness_method' ':' identifier
168186
Node(name: "ConventionWitnessMethodAttributeArguments",
169187
nameForDiagnostics: "@convention(...) arguments for witness methods",
170188
description: "The arguments for the '@convention(witness_method: ...)'.",
@@ -193,6 +211,12 @@ public let ATTRIBUTE_NODES: [Node] = [
193211
isOptional: true)
194212
]),
195213

214+
// The argument of the derivative registration attribute
215+
// '@derivative(of: ...)' and the transpose registration attribute
216+
// '@transpose(of: ...)'.
217+
//
218+
// derivative-registration-attr-arguments ->
219+
// 'of' ':' func-decl-name ','? differentiability-params-clause?
196220
Node(name: "DerivativeRegistrationAttributeArguments",
197221
nameForDiagnostics: "attribute arguments",
198222
description: "The arguments for the '@derivative(of:)' and '@transpose(of:)' attributes: the 'of:' label, the original declaration name, and an optional differentiability parameter list.",
@@ -223,11 +247,14 @@ public let ATTRIBUTE_NODES: [Node] = [
223247
isOptional: true)
224248
]),
225249

250+
// differentiability-param-list ->
251+
// differentiability-param differentiability-param-list?
226252
Node(name: "DifferentiabilityParamList",
227253
nameForDiagnostics: "differentiability parameters",
228254
kind: "SyntaxCollection",
229255
element: "DifferentiabilityParam"),
230256

257+
// differentiability-param -> ('self' | identifier | integer-literal) ','?
231258
Node(name: "DifferentiabilityParam",
232259
nameForDiagnostics: "differentiability parameter",
233260
description: "A differentiability parameter: either the \"self\" identifier, a function parameter name, or a function parameter index.",
@@ -243,6 +270,8 @@ public let ATTRIBUTE_NODES: [Node] = [
243270
isOptional: true)
244271
]),
245272

273+
// differentiability-params-clause ->
274+
// 'wrt' ':' (differentiability-param | differentiability-params)
246275
Node(name: "DifferentiabilityParamsClause",
247276
nameForDiagnostics: "'@differentiable' argument",
248277
description: "A clause containing differentiability parameters.",
@@ -264,6 +293,7 @@ public let ATTRIBUTE_NODES: [Node] = [
264293
nameForDiagnostics: "parameters")
265294
]),
266295

296+
// differentiability-params -> '(' differentiability-param-list ')'
267297
Node(name: "DifferentiabilityParams",
268298
nameForDiagnostics: "differentiability parameters",
269299
description: "The differentiability parameters.",
@@ -278,6 +308,10 @@ public let ATTRIBUTE_NODES: [Node] = [
278308
kind: .token(choices: [.token(tokenKind: "RightParenToken")]))
279309
]),
280310

311+
// The argument of '@differentiable(...)'.
312+
// differentiable-attr-arguments ->
313+
// differentiability-kind? '.'? differentiability-params-clause? ','?
314+
// generic-where-clause?
281315
Node(name: "DifferentiableAttributeArguments",
282316
nameForDiagnostics: "'@differentiable' arguments",
283317
description: "The arguments for the `@differentiable` attribute: an optional differentiability kind, an optional differentiability parameter clause, and an optional 'where' clause.",
@@ -317,7 +351,7 @@ public let ATTRIBUTE_NODES: [Node] = [
317351
Child(name: "Value",
318352
kind: .nodeChoices(choices: [
319353
Child(name: "Token",
320-
kind: .token(choices: [.token(tokenKind: "IdentifierToken"), .token(tokenKind: "KeywordToken")])),
354+
kind: .token(choices: [.token(tokenKind: "IdentifierToken"), .token(tokenKind: "KeywordToken")])), // Keywords can be: public, internal, private, fileprivate, open
321355
Child(name: "String",
322356
kind: .node(kind: "StringLiteralExpr"))
323357
])),
@@ -367,6 +401,9 @@ public let ATTRIBUTE_NODES: [Node] = [
367401
isOptional: true)
368402
]),
369403

404+
// The argument of '@_implements(...)'
405+
// implements-attr-arguments -> simple-type-identifier ','
406+
// (identifier | operator) decl-name-arguments
370407
Node(name: "ImplementsAttributeArguments",
371408
nameForDiagnostics: "@_implements arguemnts",
372409
description: "The arguments for the `@_implements` attribute of the form `Type, methodName(arg1Label:arg2Label:)`",
@@ -390,6 +427,8 @@ public let ATTRIBUTE_NODES: [Node] = [
390427
isOptional: true)
391428
]),
392429

430+
// Representation of e.g. 'exported: true,'
431+
// labeled-specialize-entry -> identifier ':' token ','?
393432
Node(name: "LabeledSpecializeEntry",
394433
nameForDiagnostics: "attribute argument",
395434
description: "A labeled argument for the `@_specialize` attribute like `exported: true`",
@@ -415,6 +454,7 @@ public let ATTRIBUTE_NODES: [Node] = [
415454
isOptional: true)
416455
]),
417456

457+
// objc-selector-piece -> identifier? ':'?
418458
Node(name: "ObjCSelectorPiece",
419459
nameForDiagnostics: "Objective-C selector piece",
420460
description: "A piece of an Objective-C selector. Either consisting of just an identifier for a nullary selector, an identifier and a colon for a labeled argument or just a colon for an unlabeled argument",
@@ -429,11 +469,13 @@ public let ATTRIBUTE_NODES: [Node] = [
429469
isOptional: true)
430470
]),
431471

472+
// objc-selector -> objc-selector-piece objc-selector?
432473
Node(name: "ObjCSelector",
433474
nameForDiagnostics: "Objective-C selector",
434475
kind: "SyntaxCollection",
435476
element: "ObjCSelectorPiece"),
436477

478+
// opaque-return-type-of-arguments -> string-literal ',' integer-literal
437479
Node(name: "OpaqueReturnTypeOfAttributeArguments",
438480
nameForDiagnostics: "opaque return type arguments",
439481
description: "The arguments for the '@_opaqueReturnTypeOf()'.",
@@ -466,6 +508,15 @@ public let ATTRIBUTE_NODES: [Node] = [
466508
kind: .collection(kind: "AvailabilityVersionRestrictionList", collectionElementName: "Platform"))
467509
]),
468510

511+
// An optionally qualified declaration name.
512+
// Currently used only for `@derivative` and `@transpose` attribute.
513+
// TODO(TF-1066): Use module qualified name syntax/parsing instead of custom
514+
// qualified name syntax/parsing.
515+
//
516+
// qualified-decl-name ->
517+
// base-type? '.'? (identifier | operator) decl-name-arguments?
518+
// base-type ->
519+
// member-type-identifier | base-type-identifier
469520
Node(name: "QualifiedDeclName",
470521
nameForDiagnostics: "declaration name",
471522
description: "An optionally qualified function declaration name (e.g. `+(_:_:)`, `A.B.C.foo(_:_:)`).",
@@ -490,6 +541,11 @@ public let ATTRIBUTE_NODES: [Node] = [
490541
isOptional: true)
491542
]),
492543

544+
// The argument of '@_specialize(...)'
545+
// specialize-attr-spec-list -> labeled-specialize-entry
546+
// specialize-spec-attr-list?
547+
// | generic-where-clause
548+
// specialize-spec-attr-list?
493549
Node(name: "SpecializeAttributeSpecList",
494550
nameForDiagnostics: "argument to '@_specialize",
495551
description: "A collection of arguments for the `@_specialize` attribute",
@@ -498,6 +554,8 @@ public let ATTRIBUTE_NODES: [Node] = [
498554
elementName: "SpecializeAttribute",
499555
elementChoices: ["LabeledSpecializeEntry", "AvailabilityEntry", "TargetFunctionEntry", "GenericWhereClause"]),
500556

557+
// Representation of e.g. 'exported: true,'
558+
// labeled-specialize-entry -> identifier ':' token ','?
501559
Node(name: "TargetFunctionEntry",
502560
nameForDiagnostics: "attribute argument",
503561
description: "A labeled argument for the `@_specialize` attribute with a function decl value like `target: myFunc(_:)`",

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift.gyb

Lines changed: 0 additions & 26 deletions
This file was deleted.

CodeGeneration/Sources/SyntaxSupport/gyb_generated/AvailabilityNodes.swift renamed to CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
public let AVAILABILITY_NODES: [Node] = [
16+
// Wrapper for all the different entries that may occur inside @available
17+
// availability-entry -> '*' ','?
18+
// | identifier ','?
19+
// | availability-version-restriction ','?
20+
// | availability-versioned-argument ','?
1621
Node(name: "AvailabilityArgument",
1722
nameForDiagnostics: "availability argument",
1823
description: "A single argument to an `@available` argument like `*`, `iOS 10.1`, or `message: \"This has been deprecated\"`.",
@@ -34,6 +39,8 @@ public let AVAILABILITY_NODES: [Node] = [
3439
isOptional: true)
3540
]),
3641

42+
// Representation of 'deprecated: 2.3', 'message: "Hello world"' etc.
43+
// availability-versioned-argument -> identifier ':' version-tuple
3744
Node(name: "AvailabilityLabeledArgument",
3845
nameForDiagnostics: "availability argument",
3946
description: "A argument to an `@available` attribute that consists of a label and a value, e.g. `message: \"This has been deprecated\"`.",
@@ -57,11 +64,14 @@ public let AVAILABILITY_NODES: [Node] = [
5764
description: "The value of this labeled argument")
5865
]),
5966

67+
// availability-spec-list -> availability-entry availability-spec-list?
6068
Node(name: "AvailabilitySpecList",
6169
nameForDiagnostics: "'@availability' arguments",
6270
kind: "SyntaxCollection",
6371
element: "AvailabilityArgument"),
6472

73+
// Representation for 'iOS 10', 'swift 3.4' etc.
74+
// availability-version-restriction -> identifier version-tuple
6575
Node(name: "AvailabilityVersionRestriction",
6676
nameForDiagnostics: "version restriction",
6777
description: "An argument to `@available` that restricts the availability on a certain platform to a version, e.g. `iOS 10` or `swift 3.4`.",
@@ -78,6 +88,9 @@ public let AVAILABILITY_NODES: [Node] = [
7888
isOptional: true)
7989
]),
8090

91+
// version-tuple -> integer-literal
92+
// | float-literal
93+
// | float-literal '.' integer-literal
8194
Node(name: "VersionTuple",
8295
nameForDiagnostics: "version tuple",
8396
description: "A version number of the form major.minor.patch in which the minor and patch part may be omitted.",

CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift.gyb

Lines changed: 0 additions & 26 deletions
This file was deleted.

CodeGeneration/Sources/SyntaxSupport/BuilderInitializableTypes.swift.gyb

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)