Skip to content

More renames of syntax nodes #1949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public let ATTRIBUTE_NODES: [Node] = [
kind: .nodeChoices(choices: [
Child(
name: "ArgumentList",
kind: .node(kind: .tupleExprElementList)
kind: .node(kind: .labeledExprList)
),
Child(
name: "Token",
Expand All @@ -72,11 +72,11 @@ public let ATTRIBUTE_NODES: [Node] = [
),
Child(
name: "Availability",
kind: .node(kind: .availabilitySpecList)
kind: .node(kind: .availabilityArgumentList)
),
Child(
name: "SpecializeArguments",
kind: .node(kind: .specializeAttributeSpecList)
kind: .node(kind: .specializeAttributeArgumentList)
),
Child(
name: "ObjCName",
Expand All @@ -92,11 +92,11 @@ public let ATTRIBUTE_NODES: [Node] = [
),
Child(
name: "DerivativeRegistrationArguments",
kind: .node(kind: .derivativeRegistrationAttributeArguments)
kind: .node(kind: .derivativeAttributeArguments)
),
Child(
name: "BackDeployedArguments",
kind: .node(kind: .backDeployedAttributeSpecList)
kind: .node(kind: .backDeployedAttributeArguments)
),
Child(
name: "ConventionArguments",
Expand All @@ -116,23 +116,23 @@ public let ATTRIBUTE_NODES: [Node] = [
),
Child(
name: "OriginallyDefinedInArguments",
kind: .node(kind: .originallyDefinedInArguments)
kind: .node(kind: .originallyDefinedInAttributeArguments)
),
Child(
name: "UnderscorePrivateAttributeArguments",
kind: .node(kind: .underscorePrivateAttributeArguments)
),
Child(
name: "DynamicReplacementArguments",
kind: .node(kind: .dynamicReplacementArguments)
kind: .node(kind: .dynamicReplacementAttributeArguments)
),
Child(
name: "UnavailableFromAsyncArguments",
kind: .node(kind: .unavailableFromAsyncArguments)
kind: .node(kind: .unavailableFromAsyncAttributeArguments)
),
Child(
name: "EffectsArguments",
kind: .node(kind: .effectsArgumentList)
kind: .node(kind: .effectsAttributeArgumentList)
),
Child(
name: "DocumentationArguments",
Expand All @@ -152,7 +152,7 @@ public let ATTRIBUTE_NODES: [Node] = [
),

Node(
kind: .availabilityEntry,
kind: .specializeAvailabilityArgument,
base: .syntax,
nameForDiagnostics: "availability entry",
documentation: "The availability argument for the _specialize attribute",
Expand All @@ -172,7 +172,7 @@ public let ATTRIBUTE_NODES: [Node] = [
Child(
name: "AvailabilityArguments",
deprecatedName: "AvailabilityList",
kind: .collection(kind: .availabilitySpecList, collectionElementName: "AvailabilityArgument", deprecatedCollectionElementName: "Availability")
kind: .collection(kind: .availabilityArgumentList, collectionElementName: "AvailabilityArgument", deprecatedCollectionElementName: "Availability")
),
Child(
name: "Semicolon",
Expand All @@ -183,15 +183,15 @@ public let ATTRIBUTE_NODES: [Node] = [

// back-deploy-version-entry -> availability-version-restriction ','?
Node(
kind: .availabilityVersionRestrictionListEntry,
kind: .platformVersionItem,
base: .syntax,
nameForDiagnostics: "version",
documentation: "A single platform/version pair in an attribute, e.g. `iOS 10.1`.",
traits: ["WithTrailingComma"],
children: [
Child(
name: "AvailabilityVersionRestriction",
kind: .node(kind: .availabilityVersionRestriction)
kind: .node(kind: .platformVersion)
),
Child(
name: "TrailingComma",
Expand All @@ -205,16 +205,16 @@ public let ATTRIBUTE_NODES: [Node] = [
// back-deploy-version-list ->
// back-deploy-version-entry back-deploy-version-list?
Node(
kind: .availabilityVersionRestrictionList,
kind: .platformVersionItemList,
base: .syntaxCollection,
nameForDiagnostics: "version list",
elementChoices: [.availabilityVersionRestrictionListEntry]
elementChoices: [.platformVersionItem]
),

// The arguments of '@backDeployed(...)'
// back-deployed-attr-spec-list -> 'before' ':' back-deployed-version-list
Node(
kind: .backDeployedAttributeSpecList,
kind: .backDeployedAttributeArguments,
base: .syntax,
nameForDiagnostics: "'@backDeployed' arguments",
documentation: "A collection of arguments for the `@backDeployed` attribute",
Expand All @@ -232,7 +232,7 @@ public let ATTRIBUTE_NODES: [Node] = [
Child(
name: "Platforms",
deprecatedName: "VersionList",
kind: .collection(kind: .availabilityVersionRestrictionList, collectionElementName: "Platform", deprecatedCollectionElementName: "Availability"),
kind: .collection(kind: .platformVersionItemList, collectionElementName: "Platform", deprecatedCollectionElementName: "Availability"),
documentation: "The list of OS versions in which the declaration became ABI stable."
),
]
Expand Down Expand Up @@ -331,7 +331,7 @@ public let ATTRIBUTE_NODES: [Node] = [
// derivative-registration-attr-arguments ->
// 'of' ':' func-decl-name ','? differentiability-params-clause?
Node(
kind: .derivativeRegistrationAttributeArguments,
kind: .derivativeAttributeArguments,
base: .syntax,
nameForDiagnostics: "attribute arguments",
documentation:
Expand Down Expand Up @@ -373,7 +373,7 @@ public let ATTRIBUTE_NODES: [Node] = [
Child(
name: "Parameters",
deprecatedName: "DiffParams",
kind: .node(kind: .differentiabilityParamsClause),
kind: .node(kind: .differentiabilityWithRespectToArgument),
isOptional: true
),
]
Expand All @@ -382,15 +382,15 @@ public let ATTRIBUTE_NODES: [Node] = [
// differentiability-param-list ->
// differentiability-param differentiability-param-list?
Node(
kind: .differentiabilityParamList,
kind: .differentiabilityParameterList,
base: .syntaxCollection,
nameForDiagnostics: "differentiability parameters",
elementChoices: [.differentiabilityParam]
elementChoices: [.differentiabilityArgument]
),

// differentiability-param -> ('self' | identifier | integer-literal) ','?
Node(
kind: .differentiabilityParam,
kind: .differentiabilityArgument,
base: .syntax,
nameForDiagnostics: "differentiability parameter",
documentation: "A differentiability parameter: either the \"self\" identifier, a function parameter name, or a function parameter index.",
Expand All @@ -413,7 +413,7 @@ public let ATTRIBUTE_NODES: [Node] = [
// differentiability-params-clause ->
// 'wrt' ':' (differentiability-param | differentiability-params)
Node(
kind: .differentiabilityParamsClause,
kind: .differentiabilityWithRespectToArgument,
base: .syntax,
nameForDiagnostics: "'@differentiable' argument",
documentation: "A clause containing differentiability parameters.",
Expand All @@ -433,11 +433,11 @@ public let ATTRIBUTE_NODES: [Node] = [
kind: .nodeChoices(choices: [
Child(
name: "Parameter",
kind: .node(kind: .differentiabilityParam)
kind: .node(kind: .differentiabilityArgument)
),
Child(
name: "ParameterList",
kind: .node(kind: .differentiabilityParams)
kind: .node(kind: .differentiabilityArguments)
),
]),
nameForDiagnostics: "parameters"
Expand All @@ -447,7 +447,7 @@ public let ATTRIBUTE_NODES: [Node] = [

// differentiability-params -> '(' differentiability-param-list ')'
Node(
kind: .differentiabilityParams,
kind: .differentiabilityArguments,
base: .syntax,
nameForDiagnostics: "differentiability parameters",
documentation: "The differentiability parameters.",
Expand All @@ -458,7 +458,7 @@ public let ATTRIBUTE_NODES: [Node] = [
),
Child(
name: "DifferentiabilityParameters",
kind: .collection(kind: .differentiabilityParamList, collectionElementName: "DifferentiabilityParam"),
kind: .collection(kind: .differentiabilityParameterList, collectionElementName: "DifferentiabilityParam"),
documentation: "The parameters for differentiation."
),
Child(
Expand Down Expand Up @@ -495,7 +495,7 @@ public let ATTRIBUTE_NODES: [Node] = [
Child(
name: "Parameters",
deprecatedName: "DiffParams",
kind: .node(kind: .differentiabilityParamsClause),
kind: .node(kind: .differentiabilityWithRespectToArgument),
isOptional: true
),
Child(
Expand Down Expand Up @@ -570,7 +570,7 @@ public let ATTRIBUTE_NODES: [Node] = [
),

Node(
kind: .dynamicReplacementArguments,
kind: .dynamicReplacementAttributeArguments,
base: .syntax,
nameForDiagnostics: "@_dynamicReplacement argument",
documentation: "The arguments for the '@_dynamicReplacement' attribute",
Expand All @@ -592,7 +592,7 @@ public let ATTRIBUTE_NODES: [Node] = [
),

Node(
kind: .effectsArgumentList,
kind: .effectsAttributeArgumentList,
base: .syntaxCollection,
nameForDiagnostics: "@_effects arguments",
documentation: "The arguments of the '@_effect' attribute. These will be parsed during the SIL stage.",
Expand Down Expand Up @@ -661,7 +661,7 @@ public let ATTRIBUTE_NODES: [Node] = [
// Representation of e.g. 'exported: true,'
// labeled-specialize-entry -> identifier ':' token ','?
Node(
kind: .labeledSpecializeEntry,
kind: .labeledSpecializeArgument,
base: .syntax,
nameForDiagnostics: "attribute argument",
documentation: "A labeled argument for the `@_specialize` attribute like `exported: true`",
Expand Down Expand Up @@ -750,7 +750,7 @@ public let ATTRIBUTE_NODES: [Node] = [
),

Node(
kind: .originallyDefinedInArguments,
kind: .originallyDefinedInAttributeArguments,
base: .syntax,
nameForDiagnostics: "@_originallyDefinedIn arguments",
documentation: "The arguments for the '@_originallyDefinedIn' attribute",
Expand All @@ -773,7 +773,7 @@ public let ATTRIBUTE_NODES: [Node] = [
),
Child(
name: "Platforms",
kind: .collection(kind: .availabilityVersionRestrictionList, collectionElementName: "Platform")
kind: .collection(kind: .platformVersionItemList, collectionElementName: "Platform")
),
]
),
Expand Down Expand Up @@ -834,17 +834,17 @@ public let ATTRIBUTE_NODES: [Node] = [
// | generic-where-clause
// specialize-spec-attr-list?
Node(
kind: .specializeAttributeSpecList,
kind: .specializeAttributeArgumentList,
base: .syntaxCollection,
nameForDiagnostics: "argument to '@_specialize",
documentation: "A collection of arguments for the `@_specialize` attribute",
elementChoices: [.labeledSpecializeEntry, .availabilityEntry, .targetFunctionEntry, .genericWhereClause]
elementChoices: [.labeledSpecializeArgument, .specializeAvailabilityArgument, .specializeTargetFunctionArgument, .genericWhereClause]
),

// Representation of e.g. 'exported: true,'
// labeled-specialize-entry -> identifier ':' token ','?
Node(
kind: .targetFunctionEntry,
kind: .specializeTargetFunctionArgument,
base: .syntax,
nameForDiagnostics: "attribute argument",
documentation: "A labeled argument for the `@_specialize` attribute with a function decl value like `target: myFunc(_:)`",
Expand Down Expand Up @@ -881,7 +881,7 @@ public let ATTRIBUTE_NODES: [Node] = [
),

Node(
kind: .unavailableFromAsyncArguments,
kind: .unavailableFromAsyncAttributeArguments,
base: .syntax,
nameForDiagnostics: "@_unavailableFromAsync argument",
documentation: "The arguments for the '@_unavailableFromAsync' attribute",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public let AVAILABILITY_NODES: [Node] = [
traits: ["WithTrailingComma"],
children: [
Child(
name: "Entry",
name: "Argument",
deprecatedName: "Entry",
kind: .nodeChoices(choices: [
Child(
name: "Token",
Expand All @@ -36,7 +37,7 @@ public let AVAILABILITY_NODES: [Node] = [
),
Child(
name: "AvailabilityVersionRestriction",
kind: .node(kind: .availabilityVersionRestriction)
kind: .node(kind: .platformVersion)
),
Child(
name: "AvailabilityLabeledArgument",
Expand Down Expand Up @@ -99,7 +100,7 @@ public let AVAILABILITY_NODES: [Node] = [

// availability-spec-list -> availability-entry availability-spec-list?
Node(
kind: .availabilitySpecList,
kind: .availabilityArgumentList,
base: .syntaxCollection,
nameForDiagnostics: "'@availability' arguments",
elementChoices: [.availabilityArgument]
Expand All @@ -108,7 +109,7 @@ public let AVAILABILITY_NODES: [Node] = [
// Representation for 'iOS 10', 'swift 3.4' etc.
// availability-version-restriction -> identifier version-tuple
Node(
kind: .availabilityVersionRestriction,
kind: .platformVersion,
base: .syntax,
nameForDiagnostics: "version restriction",
documentation: "An argument to `@available` that restricts the availability on a certain platform to a version, e.g. `iOS 10` or `swift 3.4`.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
/// builder. If the value is not nil, the result builder construct the value's
/// type and synthesize all other members to form the node.
public let BUILDER_INITIALIZABLE_TYPES: [SyntaxNodeKind: SyntaxNodeKind?] = [
.arrayElementList: nil,
.closureCaptureList: nil,
.codeBlock: .codeBlockItemList,
.memberDeclBlock: .memberDeclList,
.codeBlockItemList: nil,
.memberDeclList: nil,
.patternBindingList: nil,
.switchCaseList: nil,
.arrayElementList: nil,
.tupleExprElementList: nil,
.enumCaseElementList: nil,
.exprList: nil,
.functionParameterList: nil,
.genericArgumentList: nil,
.genericParameterList: nil,
.genericRequirementList: nil,
.inheritedTypeList: nil,
.closureCaptureItemList: nil,
.caseItemList: nil,
.genericArgumentList: nil,
.labeledExprList: nil,
.memberBlock: .memberBlockItemList,
.memberBlockItemList: nil,
.patternBindingList: nil,
.switchCaseItemList: nil,
.switchCaseList: nil,
.tuplePatternElementList: nil,
.exprList: nil,
]
4 changes: 2 additions & 2 deletions CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public let COMMON_NODES: [Node] = [

// deinit-effect-specifiers -> async?
Node(
kind: .deinitEffectSpecifiers,
kind: .deinitializerEffectSpecifiers,
base: .syntax,
nameForDiagnostics: "effect specifiers",
traits: [],
Expand Down Expand Up @@ -172,7 +172,7 @@ public let COMMON_NODES: [Node] = [
),
Child(
name: "Modifiers",
kind: .collection(kind: .modifierList, collectionElementName: "Modifier"),
kind: .collection(kind: .declModifierList, collectionElementName: "Modifier"),
documentation: "If there were standalone modifiers without a declaration to attach them to, the ``MissingDeclSyntax`` will contain these.",
isOptional: true
),
Expand Down
Loading