diff --git a/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift b/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift index a92cb990b9e..c62b7c985f3 100644 --- a/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift @@ -187,11 +187,7 @@ public let ATTRIBUTE_NODES: [Node] = [ ), Child( name: "availabilityArguments", - kind: .collection( - kind: .availabilityArgumentList, - collectionElementName: "AvailabilityArgument", - deprecatedCollectionElementName: "Availability" - ) + kind: .collection(kind: .availabilityArgumentList) ), Child( name: "semicolon", @@ -257,11 +253,7 @@ public let ATTRIBUTE_NODES: [Node] = [ ), Child( name: "platforms", - kind: .collection( - kind: .platformVersionItemList, - collectionElementName: "Platform", - deprecatedCollectionElementName: "Availability" - ), + kind: .collection(kind: .platformVersionItemList), documentation: "The list of OS versions in which the declaration became ABI stable." ), ], @@ -500,7 +492,7 @@ public let ATTRIBUTE_NODES: [Node] = [ ), Child( name: "arguments", - kind: .collection(kind: .differentiabilityArgumentList, collectionElementName: "Argument"), + kind: .collection(kind: .differentiabilityArgumentList), documentation: "The parameters for differentiation." ), Child( @@ -827,7 +819,7 @@ public let ATTRIBUTE_NODES: [Node] = [ ), Child( name: "platforms", - kind: .collection(kind: .platformVersionItemList, collectionElementName: "Platform") + kind: .collection(kind: .platformVersionItemList) ), ] ), diff --git a/CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift b/CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift index e75439ab6ab..064a71b44fc 100644 --- a/CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/AvailabilityNodes.swift @@ -175,7 +175,7 @@ public let AVAILABILITY_NODES: [Node] = [ ), Child( name: "components", - kind: .collection(kind: .versionComponentList, collectionElementName: "VersionComponent"), + kind: .collection(kind: .versionComponentList), documentation: "Any version components that are not the major version . For example, for `1.2.0`, this will contain `.2.0`." ), diff --git a/CodeGeneration/Sources/SyntaxSupport/Child.swift b/CodeGeneration/Sources/SyntaxSupport/Child.swift index 683c0441953..3ea479b2ca6 100644 --- a/CodeGeneration/Sources/SyntaxSupport/Child.swift +++ b/CodeGeneration/Sources/SyntaxSupport/Child.swift @@ -43,12 +43,7 @@ public enum ChildKind { case nodeChoices(choices: [Child], childHistory: Child.History = []) // FIXME: We don't appear to have ever generated compatibility layers for children of node choices! /// The child is a collection of `kind`. - case collection( - kind: SyntaxNodeKind, - collectionElementName: String? = nil, - defaultsToEmpty: Bool = false, - deprecatedCollectionElementName: String? = nil - ) + case collection(kind: SyntaxNodeKind, defaultsToEmpty: Bool = false) /// The child is a token that matches one of the given `choices`. /// If `requiresLeadingSpace` or `requiresTrailingSpace` is not `nil`, it /// overrides the default leading/trailing space behavior of the token. @@ -132,7 +127,7 @@ public class Child: NodeChoiceConvertible { return kind case .nodeChoices: return .syntax - case .collection(kind: let kind, _, _, _): + case .collection(kind: let kind, _): return kind case .token: return .token @@ -268,7 +263,7 @@ public class Child: NodeChoiceConvertible { /// Whether this child has syntax kind `UnexpectedNodes`. public var isUnexpectedNodes: Bool { switch kind { - case .collection(kind: .unexpectedNodes, _, _, _): + case .collection(kind: .unexpectedNodes, _): return true default: return false @@ -283,7 +278,7 @@ public class Child: NodeChoiceConvertible { return choices.isEmpty case .node(let kind): return kind.isBase - case .collection(kind: let kind, _, _, _): + case .collection(kind: let kind, _): return kind.isBase case .token: return false @@ -354,7 +349,7 @@ public class Child: NodeChoiceConvertible { self.init( name: name, - kind: .collection(kind: .unexpectedNodes, collectionElementName: name.withFirstCharacterUppercased), + kind: .collection(kind: .unexpectedNodes), experimentalFeature: earlier?.experimentalFeature ?? later?.experimentalFeature, nameForDiagnostics: nil, documentation: nil, diff --git a/CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift b/CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift index 7247e17a909..fc010c3cdd7 100644 --- a/CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/CommonNodes.swift @@ -69,7 +69,7 @@ public let COMMON_NODES: [Node] = [ ), Child( name: "statements", - kind: .collection(kind: .codeBlockItemList, collectionElementName: "Statement"), + kind: .collection(kind: .codeBlockItemList), nameForDiagnostics: "statements" ), Child( @@ -201,13 +201,13 @@ public let COMMON_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), documentation: "If there were standalone attributes without a declaration to attach them to, the ``MissingDeclSyntax`` will contain these." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), documentation: "If there were standalone modifiers without a declaration to attach them to, the ``MissingDeclSyntax`` will contain these." ), diff --git a/CodeGeneration/Sources/SyntaxSupport/CompilerNodes.swift b/CodeGeneration/Sources/SyntaxSupport/CompilerNodes.swift index 7052d76d4d4..f08dbeef076 100644 --- a/CodeGeneration/Sources/SyntaxSupport/CompilerNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/CompilerNodes.swift @@ -87,10 +87,7 @@ public let COMPILER_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection( - kind: .attributeList, - collectionElementName: "Attribute" - ) + kind: .collection(kind: .attributeList) ), Child( name: "modifiers", diff --git a/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift b/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift index 0dea2d63426..3665701f895 100644 --- a/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift @@ -65,7 +65,7 @@ public let DECL_NODES: [Node] = [ kind: .nodeChoices(choices: [ Child( name: "accessors", - kind: .collection(kind: .accessorDeclList, collectionElementName: "Accessor") + kind: .collection(kind: .accessorDeclList) ), Child( name: "getter", @@ -93,7 +93,7 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes" ), Child( @@ -192,12 +192,12 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes" ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers like `public` that are attached to the actor declaration." ), @@ -283,13 +283,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "Attributes attached to the associated type declaration." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers like `public` that are attached to the associated type declaration." ), @@ -371,13 +371,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "Attributes attached to the class declaration, such as an `@available` attribute." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers like `public` that are attached to the class declaration." ), @@ -525,13 +525,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "Attributes that are attached to the deinitializer." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers like `public` that are attached to the deinitializer." ), @@ -593,13 +593,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), documentation: "If there were attributes before the editor placeholder, the ``EditorPlaceholderDeclSyntax`` will contain these." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), documentation: "If there were modifiers before the editor placeholder, the `EditorPlaceholderDecl` will contain these." ), @@ -633,7 +633,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "parameters", - kind: .collection(kind: .enumCaseParameterList, collectionElementName: "Parameter"), + kind: .collection(kind: .enumCaseParameterList), nameForDiagnostics: "parameters", documentation: "The actual parameters." ), @@ -666,7 +666,7 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers" ), Child( @@ -725,13 +725,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "The attributes applied to the case declaration." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "The declaration modifiers applied to the case declaration." ), @@ -742,7 +742,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "elements", - kind: .collection(kind: .enumCaseElementList, collectionElementName: "Element"), + kind: .collection(kind: .enumCaseElementList), nameForDiagnostics: "elements", documentation: "The elements this case declares." ), @@ -815,13 +815,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "The attributes applied to the enum declaration." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "The declaration modifiers applied to the enum declaration." ), @@ -897,7 +897,7 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: """ Attributes that are attached to the extension declaration. @@ -913,7 +913,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers like `public` that are attached to the extension declaration." ), @@ -986,13 +986,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "Attributes that are attached to the function declaration." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers like `public` that are attached to the function declaration." ), @@ -1077,13 +1077,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "Attributes that are attached to the parameter." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers that are attached to the parameter." ), @@ -1228,7 +1228,7 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "clauses", - kind: .collection(kind: .ifConfigClauseList, collectionElementName: "Clause") + kind: .collection(kind: .ifConfigClauseList) ), Child( name: "poundEndif", @@ -1257,13 +1257,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "Attributes attached to the import declaration, for example `@testable`." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers that are attached to the import declaration. Currently, no modifiers are supported by Swift." @@ -1295,7 +1295,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "path", - kind: .collection(kind: .importPathComponentList, collectionElementName: "PathComponent"), + kind: .collection(kind: .importPathComponentList), documentation: "The path to the module, submodule or symbol being imported." ), ], @@ -1380,13 +1380,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "Attributes that are attached to the initializer." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers that are attached to the initializer declaration." ), @@ -1447,12 +1447,12 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes" ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers" ), Child( @@ -1510,12 +1510,12 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes" ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers" ), Child( @@ -1539,7 +1539,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "arguments", - kind: .collection(kind: .labeledExprList, collectionElementName: "Argument") + kind: .collection(kind: .labeledExprList) ), Child( name: "rightParen", @@ -1553,11 +1553,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "additionalTrailingClosures", - kind: .collection( - kind: .multipleTrailingClosureElementList, - collectionElementName: "AdditionalTrailingClosure", - defaultsToEmpty: true - ) + kind: .collection(kind: .multipleTrailingClosureElementList, defaultsToEmpty: true) ), ], childHistory: [ @@ -1583,7 +1579,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "members", - kind: .collection(kind: .memberBlockItemList, collectionElementName: "Member") + kind: .collection(kind: .memberBlockItemList) ), Child( name: "rightBrace", @@ -1683,7 +1679,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "designatedTypes", - kind: .collection(kind: .designatedTypeList, collectionElementName: "DesignatedTypeElement"), + kind: .collection(kind: .designatedTypeList), documentation: "The designated types associated with this operator." ), ] @@ -1703,7 +1699,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "parameters", - kind: .collection(kind: .functionParameterList, collectionElementName: "Parameter"), + kind: .collection(kind: .functionParameterList), nameForDiagnostics: "parameters" ), Child( @@ -1951,13 +1947,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "The attributes applied to the 'precedencegroup' declaration." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "The declaration modifiers applied to the 'precedencegroup' declaration." ), @@ -1976,7 +1972,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "groupAttributes", - kind: .collection(kind: .precedenceGroupAttributeList, collectionElementName: "GroupAttribute"), + kind: .collection(kind: .precedenceGroupAttributeList), documentation: "The characteristics of this precedence group." ), Child( @@ -2034,7 +2030,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "precedenceGroups", - kind: .collection(kind: .precedenceGroupNameList, collectionElementName: "OtherName"), + kind: .collection(kind: .precedenceGroupNameList), documentation: "The name of other precedence group to which this precedence group relates." ), ], @@ -2070,13 +2066,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "Attributes attached to the protocol declaration, such as an `@available` attribute." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers attached to the protocol declaration, such as `public`." ), @@ -2163,7 +2159,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "statements", - kind: .collection(kind: .codeBlockItemList, collectionElementName: "Statement") + kind: .collection(kind: .codeBlockItemList) ), Child( name: "endOfFileToken", @@ -2250,13 +2246,13 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes", documentation: "Attributes that are attached to the struct declaration." ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers like `public` that are attached to the struct declaration." ), @@ -2319,12 +2315,12 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes" ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers" ), Child( @@ -2380,7 +2376,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "inheritedTypes", - kind: .collection(kind: .inheritedTypeList, collectionElementName: "InheritedType") + kind: .collection(kind: .inheritedTypeList) ), ], childHistory: [ @@ -2420,12 +2416,12 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes" ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers" ), Child( @@ -2480,12 +2476,12 @@ public let DECL_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes" ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers", documentation: "Modifiers modifiers applied to the variable declaration." ), @@ -2501,7 +2497,7 @@ public let DECL_NODES: [Node] = [ ), Child( name: "bindings", - kind: .collection(kind: .patternBindingList, collectionElementName: "Binding"), + kind: .collection(kind: .patternBindingList), documentation: """ The pattern bindings that define the actual variables. diff --git a/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift b/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift index 7aad34d15ec..d8a5d6569a9 100644 --- a/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift @@ -52,7 +52,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "elements", - kind: .collection(kind: .arrayElementList, collectionElementName: "Element") + kind: .collection(kind: .arrayElementList) ), Child( name: "rightSquare", @@ -412,7 +412,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "items", - kind: .collection(kind: .closureCaptureList, collectionElementName: "Item") + kind: .collection(kind: .closureCaptureList) ), Child( name: "rightSquare", @@ -430,12 +430,12 @@ public let EXPR_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes" ), Child( name: "modifiers", - kind: .collection(kind: .declModifierList, collectionElementName: "Modifier", defaultsToEmpty: true), + kind: .collection(kind: .declModifierList, defaultsToEmpty: true), nameForDiagnostics: "modifiers" ), Child( @@ -500,7 +500,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "parameters", - kind: .collection(kind: .closureParameterList, collectionElementName: "Parameter"), + kind: .collection(kind: .closureParameterList), nameForDiagnostics: "parameters", documentation: "The actual parameters." ), @@ -537,7 +537,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "statements", - kind: .collection(kind: .codeBlockItemList, collectionElementName: "Statement") + kind: .collection(kind: .codeBlockItemList) ), Child( name: "rightBrace", @@ -598,7 +598,7 @@ public let EXPR_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), nameForDiagnostics: "attributes" ), Child( @@ -688,7 +688,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "arguments", - kind: .collection(kind: .declNameArgumentList, collectionElementName: "Argument") + kind: .collection(kind: .declNameArgumentList) ), Child( name: "rightParen", @@ -840,7 +840,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "catchClauses", - kind: .collection(kind: .catchClauseList, collectionElementName: "CatchClause", defaultsToEmpty: true) + kind: .collection(kind: .catchClauseList, defaultsToEmpty: true) ), ] ), @@ -901,7 +901,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "expressions", - kind: .collection(kind: .labeledExprList, collectionElementName: "Expression") + kind: .collection(kind: .labeledExprList) ), Child( name: "rightParen", @@ -966,7 +966,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "arguments", - kind: .collection(kind: .labeledExprList, collectionElementName: "Argument"), + kind: .collection(kind: .labeledExprList), nameForDiagnostics: "arguments" ), Child( @@ -983,11 +983,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "additionalTrailingClosures", - kind: .collection( - kind: .multipleTrailingClosureElementList, - collectionElementName: "AdditionalTrailingClosure", - defaultsToEmpty: true - ), + kind: .collection(kind: .multipleTrailingClosureElementList, defaultsToEmpty: true), nameForDiagnostics: "trailing closures" ), ], @@ -1045,7 +1041,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "conditions", - kind: .collection(kind: .conditionElementList, collectionElementName: "Condition") + kind: .collection(kind: .conditionElementList) ), Child( name: "body", @@ -1248,7 +1244,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "components", - kind: .collection(kind: .keyPathComponentList, collectionElementName: "KeyPathComponent") + kind: .collection(kind: .keyPathComponentList) ), ] ), @@ -1296,7 +1292,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "arguments", - kind: .collection(kind: .labeledExprList, collectionElementName: "Argument"), + kind: .collection(kind: .labeledExprList), nameForDiagnostics: "arguments" ), Child( @@ -1343,7 +1339,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "arguments", - kind: .collection(kind: .labeledExprList, collectionElementName: "Argument") + kind: .collection(kind: .labeledExprList) ), Child( name: "rightParen", @@ -1357,11 +1353,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "additionalTrailingClosures", - kind: .collection( - kind: .multipleTrailingClosureElementList, - collectionElementName: "AdditionalTrailingClosure", - defaultsToEmpty: true - ) + kind: .collection(kind: .multipleTrailingClosureElementList, defaultsToEmpty: true) ), ], childHistory: [ @@ -1668,7 +1660,7 @@ public let EXPR_NODES: [Node] = [ children: [ Child( name: "elements", - kind: .collection(kind: .exprList, collectionElementName: "Element") + kind: .collection(kind: .exprList) ) ] ), @@ -1714,7 +1706,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "segments", - kind: .collection(kind: .stringLiteralSegmentList, collectionElementName: "Segment") + kind: .collection(kind: .stringLiteralSegmentList) ), Child( name: "closingQuote", @@ -1756,7 +1748,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "segments", - kind: .collection(kind: .simpleStringLiteralSegmentList, collectionElementName: "Segment"), + kind: .collection(kind: .simpleStringLiteralSegmentList), documentation: "String content" ), Child( @@ -1808,7 +1800,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "arguments", - kind: .collection(kind: .labeledExprList, collectionElementName: "Argument"), + kind: .collection(kind: .labeledExprList), nameForDiagnostics: "arguments" ), Child( @@ -1823,11 +1815,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "additionalTrailingClosures", - kind: .collection( - kind: .multipleTrailingClosureElementList, - collectionElementName: "AdditionalTrailingClosure", - defaultsToEmpty: true - ), + kind: .collection(kind: .multipleTrailingClosureElementList, defaultsToEmpty: true), nameForDiagnostics: "trailing closures" ), ], @@ -1863,7 +1851,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "caseItems", - kind: .collection(kind: .switchCaseItemList, collectionElementName: "CaseItem") + kind: .collection(kind: .switchCaseItemList) ), Child( name: "colon", @@ -1908,7 +1896,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "statements", - kind: .collection(kind: .codeBlockItemList, collectionElementName: "Statement") + kind: .collection(kind: .codeBlockItemList) ), ], childHistory: [ @@ -1973,7 +1961,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "cases", - kind: .collection(kind: .switchCaseList, collectionElementName: "Case"), + kind: .collection(kind: .switchCaseList), documentation: "The switch's body that contains all possible cases." ), Child( @@ -2138,7 +2126,7 @@ public let EXPR_NODES: [Node] = [ ), Child( name: "elements", - kind: .collection(kind: .labeledExprList, collectionElementName: "Element") + kind: .collection(kind: .labeledExprList) ), Child( name: "rightParen", diff --git a/CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift b/CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift index a54368b8dd6..eb4948d585f 100644 --- a/CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift @@ -51,11 +51,7 @@ public let GENERIC_NODES: [Node] = [ ), Child( name: "parameters", - kind: .collection( - kind: .genericParameterList, - collectionElementName: "Parameter", - deprecatedCollectionElementName: "GenericParameter" - ), + kind: .collection(kind: .genericParameterList), documentation: "The list of generic parameters in the clause." ), Child( @@ -98,7 +94,7 @@ public let GENERIC_NODES: [Node] = [ children: [ Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true) + kind: .collection(kind: .attributeList, defaultsToEmpty: true) ), Child( name: "specifier", @@ -197,7 +193,7 @@ public let GENERIC_NODES: [Node] = [ ), Child( name: "requirements", - kind: .collection(kind: .genericRequirementList, collectionElementName: "Requirement"), + kind: .collection(kind: .genericRequirementList), documentation: "The list of requirements in the clause." ), ], @@ -283,7 +279,7 @@ public let GENERIC_NODES: [Node] = [ ), Child( name: "primaryAssociatedTypes", - kind: .collection(kind: .primaryAssociatedTypeList, collectionElementName: "PrimaryAssociatedType") + kind: .collection(kind: .primaryAssociatedTypeList) ), Child( name: "rightAngle", diff --git a/CodeGeneration/Sources/SyntaxSupport/GrammarGenerator.swift b/CodeGeneration/Sources/SyntaxSupport/GrammarGenerator.swift index ae84735dbf9..b194524b8fc 100644 --- a/CodeGeneration/Sources/SyntaxSupport/GrammarGenerator.swift +++ b/CodeGeneration/Sources/SyntaxSupport/GrammarGenerator.swift @@ -41,7 +41,7 @@ struct GrammarGenerator { case .nodeChoices(let choices, _): let choicesDescriptions = choices.map { grammar(for: $0) } return "(\(choicesDescriptions.joined(separator: " | ")))\(optionality)" - case .collection(kind: let kind, _, _, _): + case .collection(kind: let kind, _): return "\(kind.doccLink)\(optionality)" case .token(let choices, _, _): if choices.count == 1 { diff --git a/CodeGeneration/Sources/SyntaxSupport/Node.swift b/CodeGeneration/Sources/SyntaxSupport/Node.swift index 913473c1c85..4e7446b0a4a 100644 --- a/CodeGeneration/Sources/SyntaxSupport/Node.swift +++ b/CodeGeneration/Sources/SyntaxSupport/Node.swift @@ -391,7 +391,7 @@ fileprivate extension Child { return [kind] case .nodeChoices(let choices, _): return choices.flatMap(\.kinds) - case .collection(kind: let kind, _, _, _): + case .collection(kind: let kind, _): return [kind] case .token: return [.token] diff --git a/CodeGeneration/Sources/SyntaxSupport/PatternNodes.swift b/CodeGeneration/Sources/SyntaxSupport/PatternNodes.swift index dbb019dfebb..f1978d29db9 100644 --- a/CodeGeneration/Sources/SyntaxSupport/PatternNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/PatternNodes.swift @@ -167,7 +167,7 @@ public let PATTERN_NODES: [Node] = [ ), Child( name: "elements", - kind: .collection(kind: .tuplePatternElementList, collectionElementName: "Element") + kind: .collection(kind: .tuplePatternElementList) ), Child( name: "rightParen", diff --git a/CodeGeneration/Sources/SyntaxSupport/StmtNodes.swift b/CodeGeneration/Sources/SyntaxSupport/StmtNodes.swift index a2eb4305ffd..740b3261f3e 100644 --- a/CodeGeneration/Sources/SyntaxSupport/StmtNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/StmtNodes.swift @@ -26,7 +26,7 @@ public let STMT_NODES: [Node] = [ ), Child( name: "availabilityArguments", - kind: .collection(kind: .availabilityArgumentList, collectionElementName: "AvailabilityArgument") + kind: .collection(kind: .availabilityArgumentList) ), Child( name: "rightParen", @@ -85,7 +85,7 @@ public let STMT_NODES: [Node] = [ ), Child( name: "catchItems", - kind: .collection(kind: .catchItemList, collectionElementName: "CatchItem", defaultsToEmpty: true) + kind: .collection(kind: .catchItemList, defaultsToEmpty: true) ), Child( name: "body", @@ -233,7 +233,7 @@ public let STMT_NODES: [Node] = [ ), Child( name: "catchClauses", - kind: .collection(kind: .catchClauseList, collectionElementName: "CatchClause", defaultsToEmpty: true) + kind: .collection(kind: .catchClauseList, defaultsToEmpty: true) ), ] ), @@ -354,7 +354,7 @@ public let STMT_NODES: [Node] = [ ), Child( name: "conditions", - kind: .collection(kind: .conditionElementList, collectionElementName: "Condition"), + kind: .collection(kind: .conditionElementList), nameForDiagnostics: "condition" ), Child( @@ -552,7 +552,7 @@ public let STMT_NODES: [Node] = [ ), Child( name: "conditions", - kind: .collection(kind: .conditionElementList, collectionElementName: "Condition") + kind: .collection(kind: .conditionElementList) ), Child( name: "body", @@ -572,7 +572,7 @@ public let STMT_NODES: [Node] = [ ), Child( name: "elements", - kind: .collection(kind: .yieldedExpressionList, collectionElementName: "Element") + kind: .collection(kind: .yieldedExpressionList) ), Child( name: "rightParen", diff --git a/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift b/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift index ac5b1a8f8a4..f9948de6972 100644 --- a/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift @@ -48,13 +48,13 @@ public let TYPE_NODES: [Node] = [ children: [ Child( name: "specifiers", - kind: .collection(kind: .typeSpecifierList, collectionElementName: "Specifier", defaultsToEmpty: true), + kind: .collection(kind: .typeSpecifierList, defaultsToEmpty: true), documentation: "A list of specifiers that can be attached to the type, such as `inout`, `isolated`, or `consuming`." ), Child( name: "attributes", - kind: .collection(kind: .attributeList, collectionElementName: "Attribute", defaultsToEmpty: true), + kind: .collection(kind: .attributeList, defaultsToEmpty: true), documentation: "A list of attributes that can be attached to the type, such as `@escaping`." ), Child( @@ -108,7 +108,7 @@ public let TYPE_NODES: [Node] = [ children: [ Child( name: "elements", - kind: .collection(kind: .compositionTypeElementList, collectionElementName: "Element") + kind: .collection(kind: .compositionTypeElementList) ) ] ), @@ -186,11 +186,7 @@ public let TYPE_NODES: [Node] = [ ), Child( name: "parameters", - kind: .collection( - kind: .tupleTypeElementList, - collectionElementName: "Parameter", - deprecatedCollectionElementName: "Argument" - ) + kind: .collection(kind: .tupleTypeElementList) ), Child( name: "rightParen", @@ -225,7 +221,7 @@ public let TYPE_NODES: [Node] = [ ), Child( name: "arguments", - kind: .collection(kind: .genericArgumentList, collectionElementName: "Argument") + kind: .collection(kind: .genericArgumentList) ), Child( name: "rightAngle", @@ -551,7 +547,7 @@ public let TYPE_NODES: [Node] = [ ), Child( name: "elements", - kind: .collection(kind: .tupleTypeElementList, collectionElementName: "Element") + kind: .collection(kind: .tupleTypeElementList) ), Child( name: "rightParen", @@ -626,7 +622,7 @@ public let TYPE_NODES: [Node] = [ ), Child( name: "arguments", - kind: .collection(kind: .lifetimeSpecifierArgumentList, collectionElementName: "Arguments") + kind: .collection(kind: .lifetimeSpecifierArgumentList) ), Child( name: "rightParen", diff --git a/CodeGeneration/Sources/Utils/SyntaxBuildableChild.swift b/CodeGeneration/Sources/Utils/SyntaxBuildableChild.swift index 9ad78761e04..4650eeaddfe 100644 --- a/CodeGeneration/Sources/Utils/SyntaxBuildableChild.swift +++ b/CodeGeneration/Sources/Utils/SyntaxBuildableChild.swift @@ -33,7 +33,7 @@ extension Child { buildableKind = .node(kind: kind) case .nodeChoices: buildableKind = .node(kind: .syntax) - case .collection(kind: let kind, _, _, _): + case .collection(kind: let kind, _): buildableKind = .node(kind: kind) case .token: buildableKind = .token(self.tokenKind!) @@ -65,7 +65,7 @@ extension Child { return ExprSyntax("nil") } } - if case .collection(_, _, defaultsToEmpty: true, _) = kind { + if case .collection(_, defaultsToEmpty: true) = kind { return ExprSyntax("[]") } guard let token = token, isToken else { diff --git a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/RenamedChildrenCompatibilityFile.swift b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/RenamedChildrenCompatibilityFile.swift index aea1375e54c..d986f31d2a8 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/RenamedChildrenCompatibilityFile.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/RenamedChildrenCompatibilityFile.swift @@ -22,9 +22,6 @@ let renamedChildrenCompatibilityFile = try! SourceFileSyntax(leadingTrivia: copy try ExtensionDeclSyntax("extension \(layoutNode.type.syntaxBaseName)") { for child in deprecatedMembers.vars { makeCompatibilityVar(for: child) - if let addMethod = makeCompatibilityAddMethod(for: child) { - addMethod - } } let renamedName = InitSignature(layoutNode).compoundName @@ -40,9 +37,6 @@ let renamedChildrenCompatibilityFile = try! SourceFileSyntax(leadingTrivia: copy try ExtensionDeclSyntax("extension \(trait.protocolName)") { for child in deprecatedMembers.vars { makeCompatibilityVar(for: child) - if let addMethod = makeCompatibilityAddMethod(for: child) { - addMethod - } } // Not currently generating compatibility inits for traits. @@ -78,31 +72,6 @@ func makeCompatibilityVar(for child: Child) -> DeclSyntax { ) } -func makeCompatibilityAddMethod(for child: Child) -> DeclSyntax? { - if let childNode = SYNTAX_NODE_MAP[child.syntaxNodeKind]?.collectionNode, - !child.isUnexpectedNodes, - case .collection( - kind: _, - collectionElementName: let collectionElementName?, - defaultsToEmpty: _, - deprecatedCollectionElementName: let deprecatedCollectionElementName? - ) = child.kind - { - let childEltType = childNode.collectionElementType.syntaxBaseName - - return DeclSyntax( - """ - @available(*, deprecated, renamed: "add\(raw: collectionElementName)") - public func add\(raw: deprecatedCollectionElementName)(_ element: \(childEltType)) -> Self { - return add\(raw: collectionElementName)(element) - } - """ - ) - } - - return nil -} - func makeCompatibilityInit(for signature: InitSignature, renamedName: String) -> InitializerDeclSyntax { try! InitializerDeclSyntax( """ diff --git a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift index 6c5bd8bad67..170057d0ed4 100644 --- a/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift +++ b/CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxNodesFile.swift @@ -168,44 +168,6 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax { """ ) } - - // =============== - // Adding children - // =============== - // We don't currently support adding elements to a specific unexpected collection. - // If needed, this could be added in the future, but for now withUnexpected should be sufficient. - if let childNode = SYNTAX_NODE_MAP[child.syntaxNodeKind]?.collectionNode, - !child.isUnexpectedNodes, - case .collection(_, collectionElementName: let childElt?, _, _) = child.kind - { - let childEltType = childNode.collectionElementType.syntaxBaseName - - DeclSyntax( - """ - /// Adds the provided `element` to the node's `\(child.identifier)` - /// collection. - /// - /// - param element: The new `\(raw: childElt)` to add to the node's - /// `\(child.identifier)` collection. - /// - returns: A copy of the receiver with the provided `\(raw: childElt)` - /// appended to its `\(child.identifier)` collection. - @available(*, deprecated, message: "Use node.\(child.identifier).append(newElement) instead") - public func add\(raw: childElt)(_ element: \(childEltType)) -> \(node.kind.syntaxType) { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[\(raw: index)] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.\(childNode.memberCallName), - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild(at: \(raw: index), with: collection, rawNodeArena: arena, rawAllocationArena: arena) - .cast(\(node.kind.syntaxType).self) - } - """ - ) - } } let layout = ArrayExprSyntax { diff --git a/CodeGeneration/Tests/ValidateSyntaxNodes/ValidateSyntaxNodes.swift b/CodeGeneration/Tests/ValidateSyntaxNodes/ValidateSyntaxNodes.swift index a6a7d8f03ad..5b668bbb4f9 100644 --- a/CodeGeneration/Tests/ValidateSyntaxNodes/ValidateSyntaxNodes.swift +++ b/CodeGeneration/Tests/ValidateSyntaxNodes/ValidateSyntaxNodes.swift @@ -55,13 +55,13 @@ fileprivate extension ChildKind { return kind == otherKind case (.nodeChoices(let choices, _), .nodeChoices(let otherChoices, _)): return choices.count == otherChoices.count && zip(choices, otherChoices).allSatisfy { $0.hasSameType(as: $1) } - case (.collection(kind: let kind, _, _, _), .collection(kind: let otherKind, _, _, _)): + case (.collection(kind: let kind, _), .collection(kind: let otherKind, _)): return kind == otherKind case (.token(let choices, _, _), .token(let otherChoices, _, _)): return choices == otherChoices - case (.node(let kind), .collection(kind: let otherKind, _, _, _)): + case (.node(let kind), .collection(kind: let otherKind, _)): return kind == otherKind - case (.collection(kind: let kind, _, _, _), .node(let otherKind)): + case (.collection(kind: let kind, _), .node(let otherKind)): return kind == otherKind default: return false diff --git a/Sources/SwiftSyntax/generated/RenamedChildrenCompatibility.swift b/Sources/SwiftSyntax/generated/RenamedChildrenCompatibility.swift index a3b1e896b37..1569a2cb611 100644 --- a/Sources/SwiftSyntax/generated/RenamedChildrenCompatibility.swift +++ b/Sources/SwiftSyntax/generated/RenamedChildrenCompatibility.swift @@ -869,11 +869,6 @@ extension BackDeployedAttributeArgumentsSyntax { } } - @available(*, deprecated, renamed: "addPlatform") - public func addAvailability(_ element: PlatformVersionItemSyntax) -> Self { - return addPlatform(element) - } - @available(*, deprecated, renamed: "unexpectedAfterPlatforms") public var unexpectedAfterVersionList: UnexpectedNodesSyntax? { get { @@ -3270,11 +3265,6 @@ extension FunctionTypeSyntax { } } - @available(*, deprecated, renamed: "addParameter") - public func addArgument(_ element: TupleTypeElementSyntax) -> Self { - return addParameter(element) - } - @available(*, deprecated, renamed: "unexpectedBetweenParametersAndRightParen") public var unexpectedBetweenArgumentsAndRightParen: UnexpectedNodesSyntax? { get { @@ -3533,11 +3523,6 @@ extension GenericParameterClauseSyntax { } } - @available(*, deprecated, renamed: "addParameter") - public func addGenericParameter(_ element: GenericParameterSyntax) -> Self { - return addParameter(element) - } - @available(*, deprecated, renamed: "unexpectedBetweenParametersAndGenericWhereClause") public var unexpectedBetweenGenericParameterListAndGenericWhereClause: UnexpectedNodesSyntax? { get { @@ -6864,11 +6849,6 @@ extension SpecializeAvailabilityArgumentSyntax { } } - @available(*, deprecated, renamed: "addAvailabilityArgument") - public func addAvailability(_ element: AvailabilityArgumentSyntax) -> Self { - return addAvailabilityArgument(element) - } - @available(*, deprecated, renamed: "unexpectedBetweenAvailabilityArgumentsAndSemicolon") public var unexpectedBetweenAvailabilityListAndSemicolon: UnexpectedNodesSyntax? { get { diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift index 5d2eccd0e58..65f4edfe340 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift @@ -931,33 +931,6 @@ public struct AccessorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> AccessorDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(AccessorDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifier: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -1497,33 +1470,6 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> ActorDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ActorDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -1543,33 +1489,6 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> ActorDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ActorDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndActorKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1951,33 +1870,6 @@ public struct ArrayExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } - /// Adds the provided `element` to the node's `elements` - /// collection. - /// - /// - param element: The new `Element` to add to the node's - /// `elements` collection. - /// - returns: A copy of the receiver with the provided `Element` - /// appended to its `elements` collection. - @available(*, deprecated, message: "Use node.elements.append(newElement) instead") - public func addElement(_ element: ArrayElementSyntax) -> ArrayExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.arrayElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ArrayExprSyntax.self) - } - public var unexpectedBetweenElementsAndRightSquare: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -2709,33 +2601,6 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> AssociatedTypeDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(AssociatedTypeDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -2755,33 +2620,6 @@ public struct AssociatedTypeDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> AssociatedTypeDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(AssociatedTypeDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndAssociatedtypeKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3001,33 +2839,6 @@ public struct AttributeClauseFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSy } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> AttributeClauseFileSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(AttributeClauseFileSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -4104,33 +3915,6 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp } } - /// Adds the provided `element` to the node's `specifiers` - /// collection. - /// - /// - param element: The new `Specifier` to add to the node's - /// `specifiers` collection. - /// - returns: A copy of the receiver with the provided `Specifier` - /// appended to its `specifiers` collection. - @available(*, deprecated, message: "Use node.specifiers.append(newElement) instead") - public func addSpecifier(_ element: Syntax) -> AttributedTypeSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.typeSpecifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(AttributedTypeSyntax.self) - } - public var unexpectedBetweenSpecifiersAndAttributes: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -4150,33 +3934,6 @@ public struct AttributedTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTyp } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> AttributedTypeSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(AttributedTypeSyntax.self) - } - public var unexpectedBetweenAttributesAndBaseType: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4600,33 +4357,6 @@ public struct AvailabilityConditionSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } - /// Adds the provided `element` to the node's `availabilityArguments` - /// collection. - /// - /// - param element: The new `AvailabilityArgument` to add to the node's - /// `availabilityArguments` collection. - /// - returns: A copy of the receiver with the provided `AvailabilityArgument` - /// appended to its `availabilityArguments` collection. - @available(*, deprecated, message: "Use node.availabilityArguments.append(newElement) instead") - public func addAvailabilityArgument(_ element: AvailabilityArgumentSyntax) -> AvailabilityConditionSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.availabilityArgumentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(AvailabilityConditionSyntax.self) - } - public var unexpectedBetweenAvailabilityArgumentsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -5351,33 +5081,6 @@ public struct BackDeployedAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashab } } - /// Adds the provided `element` to the node's `platforms` - /// collection. - /// - /// - param element: The new `Platform` to add to the node's - /// `platforms` collection. - /// - returns: A copy of the receiver with the provided `Platform` - /// appended to its `platforms` collection. - @available(*, deprecated, message: "Use node.platforms.append(newElement) instead") - public func addPlatform(_ element: PlatformVersionItemSyntax) -> BackDeployedAttributeArgumentsSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.platformVersionItemList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(BackDeployedAttributeArgumentsSyntax.self) - } - public var unexpectedAfterPlatforms: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift index 5e3d1201b2f..c8c4d9b6ca0 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift @@ -512,33 +512,6 @@ public struct CatchClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode } } - /// Adds the provided `element` to the node's `catchItems` - /// collection. - /// - /// - param element: The new `CatchItem` to add to the node's - /// `catchItems` collection. - /// - returns: A copy of the receiver with the provided `CatchItem` - /// appended to its `catchItems` collection. - @available(*, deprecated, message: "Use node.catchItems.append(newElement) instead") - public func addCatchItem(_ element: CatchItemSyntax) -> CatchClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.catchItemList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(CatchClauseSyntax.self) - } - public var unexpectedBetweenCatchItemsAndBody: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -878,33 +851,6 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> ClassDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ClassDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -924,33 +870,6 @@ public struct ClassDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> ClassDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ClassDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndClassKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1291,33 +1210,6 @@ public struct ClosureCaptureClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafS } } - /// Adds the provided `element` to the node's `items` - /// collection. - /// - /// - param element: The new `Item` to add to the node's - /// `items` collection. - /// - returns: A copy of the receiver with the provided `Item` - /// appended to its `items` collection. - @available(*, deprecated, message: "Use node.items.append(newElement) instead") - public func addItem(_ element: ClosureCaptureSyntax) -> ClosureCaptureClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.closureCaptureList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ClosureCaptureClauseSyntax.self) - } - public var unexpectedBetweenItemsAndRightSquare: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1866,33 +1758,6 @@ public struct ClosureExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy } } - /// Adds the provided `element` to the node's `statements` - /// collection. - /// - /// - param element: The new `Statement` to add to the node's - /// `statements` collection. - /// - returns: A copy of the receiver with the provided `Statement` - /// appended to its `statements` collection. - @available(*, deprecated, message: "Use node.statements.append(newElement) instead") - public func addStatement(_ element: CodeBlockItemSyntax) -> ClosureExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.codeBlockItemList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ClosureExprSyntax.self) - } - public var unexpectedBetweenStatementsAndRightBrace: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -2052,33 +1917,6 @@ public struct ClosureParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `parameters` - /// collection. - /// - /// - param element: The new `Parameter` to add to the node's - /// `parameters` collection. - /// - returns: A copy of the receiver with the provided `Parameter` - /// appended to its `parameters` collection. - @available(*, deprecated, message: "Use node.parameters.append(newElement) instead") - public func addParameter(_ element: ClosureParameterSyntax) -> ClosureParameterClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.closureParameterList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ClosureParameterClauseSyntax.self) - } - public var unexpectedBetweenParametersAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -2252,33 +2090,6 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> ClosureParameterSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ClosureParameterSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -2297,33 +2108,6 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> ClosureParameterSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ClosureParameterSyntax.self) - } - public var unexpectedBetweenModifiersAndFirstName: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -2808,33 +2592,6 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> ClosureSignatureSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ClosureSignatureSyntax.self) - } - public var unexpectedBetweenAttributesAndCapture: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -3439,33 +3196,6 @@ public struct CodeBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodePr } } - /// Adds the provided `element` to the node's `statements` - /// collection. - /// - /// - param element: The new `Statement` to add to the node's - /// `statements` collection. - /// - returns: A copy of the receiver with the provided `Statement` - /// appended to its `statements` collection. - @available(*, deprecated, message: "Use node.statements.append(newElement) instead") - public func addStatement(_ element: CodeBlockItemSyntax) -> CodeBlockSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.codeBlockItemList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(CodeBlockSyntax.self) - } - public var unexpectedBetweenStatementsAndRightBrace: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3690,33 +3420,6 @@ public struct CompositionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTy } } - /// Adds the provided `element` to the node's `elements` - /// collection. - /// - /// - param element: The new `Element` to add to the node's - /// `elements` collection. - /// - returns: A copy of the receiver with the provided `Element` - /// appended to its `elements` collection. - @available(*, deprecated, message: "Use node.elements.append(newElement) instead") - public func addElement(_ element: CompositionTypeElementSyntax) -> CompositionTypeSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.compositionTypeElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(CompositionTypeSyntax.self) - } - public var unexpectedAfterElements: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift index de11563f88c..d6680784852 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift @@ -555,33 +555,6 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } - /// Adds the provided `element` to the node's `arguments` - /// collection. - /// - /// - param element: The new `Argument` to add to the node's - /// `arguments` collection. - /// - returns: A copy of the receiver with the provided `Argument` - /// appended to its `arguments` collection. - @available(*, deprecated, message: "Use node.arguments.append(newElement) instead") - public func addArgument(_ element: DeclNameArgumentSyntax) -> DeclNameArgumentsSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declNameArgumentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(DeclNameArgumentsSyntax.self) - } - public var unexpectedBetweenArgumentsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -987,33 +960,6 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> DeinitializerDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(DeinitializerDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -1033,33 +979,6 @@ public struct DeinitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Leaf } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> DeinitializerDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(DeinitializerDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndDeinitKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -2497,33 +2416,6 @@ public struct DifferentiabilityArgumentsSyntax: SyntaxProtocol, SyntaxHashable, } } - /// Adds the provided `element` to the node's `arguments` - /// collection. - /// - /// - param element: The new `Argument` to add to the node's - /// `arguments` collection. - /// - returns: A copy of the receiver with the provided `Argument` - /// appended to its `arguments` collection. - @available(*, deprecated, message: "Use node.arguments.append(newElement) instead") - public func addArgument(_ element: DifferentiabilityArgumentSyntax) -> DifferentiabilityArgumentsSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.differentiabilityArgumentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(DifferentiabilityArgumentsSyntax.self) - } - public var unexpectedBetweenArgumentsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3388,33 +3280,6 @@ public struct DoExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN } } - /// Adds the provided `element` to the node's `catchClauses` - /// collection. - /// - /// - param element: The new `CatchClause` to add to the node's - /// `catchClauses` collection. - /// - returns: A copy of the receiver with the provided `CatchClause` - /// appended to its `catchClauses` collection. - @available(*, deprecated, message: "Use node.catchClauses.append(newElement) instead") - public func addCatchClause(_ element: CatchClauseSyntax) -> DoExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.catchClauseList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(DoExprSyntax.self) - } - public var unexpectedAfterCatchClauses: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -3586,33 +3451,6 @@ public struct DoStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSyntaxN } } - /// Adds the provided `element` to the node's `catchClauses` - /// collection. - /// - /// - param element: The new `CatchClause` to add to the node's - /// `catchClauses` collection. - /// - returns: A copy of the receiver with the provided `CatchClause` - /// appended to its `catchClauses` collection. - @available(*, deprecated, message: "Use node.catchClauses.append(newElement) instead") - public func addCatchClause(_ element: CatchClauseSyntax) -> DoStmtSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[7] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.catchClauseList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 7, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(DoStmtSyntax.self) - } - public var unexpectedAfterCatchClauses: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 8)?.cast(UnexpectedNodesSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift index 03a3eb26386..549a6111bfa 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift @@ -105,33 +105,6 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> EditorPlaceholderDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(EditorPlaceholderDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -151,33 +124,6 @@ public struct EditorPlaceholderDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _ } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> EditorPlaceholderDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(EditorPlaceholderDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndPlaceholder: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -400,33 +346,6 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> EnumCaseDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(EnumCaseDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -446,33 +365,6 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> EnumCaseDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(EnumCaseDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndCaseKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -515,33 +407,6 @@ public struct EnumCaseDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `elements` - /// collection. - /// - /// - param element: The new `Element` to add to the node's - /// `elements` collection. - /// - returns: A copy of the receiver with the provided `Element` - /// appended to its `elements` collection. - @available(*, deprecated, message: "Use node.elements.append(newElement) instead") - public func addElement(_ element: EnumCaseElementSyntax) -> EnumCaseDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[7] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.enumCaseElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 7, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(EnumCaseDeclSyntax.self) - } - public var unexpectedAfterElements: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 8)?.cast(UnexpectedNodesSyntax.self) @@ -870,33 +735,6 @@ public struct EnumCaseParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le } } - /// Adds the provided `element` to the node's `parameters` - /// collection. - /// - /// - param element: The new `Parameter` to add to the node's - /// `parameters` collection. - /// - returns: A copy of the receiver with the provided `Parameter` - /// appended to its `parameters` collection. - @available(*, deprecated, message: "Use node.parameters.append(newElement) instead") - public func addParameter(_ element: EnumCaseParameterSyntax) -> EnumCaseParameterClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.enumCaseParameterList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(EnumCaseParameterClauseSyntax.self) - } - public var unexpectedBetweenParametersAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1061,33 +899,6 @@ public struct EnumCaseParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> EnumCaseParameterSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(EnumCaseParameterSyntax.self) - } - public var unexpectedBetweenModifiersAndFirstName: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -1377,33 +1188,6 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> EnumDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(EnumDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -1423,33 +1207,6 @@ public struct EnumDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynta } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> EnumDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(EnumDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndEnumKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -2011,33 +1768,6 @@ public struct ExpressionSegmentSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } - /// Adds the provided `element` to the node's `expressions` - /// collection. - /// - /// - param element: The new `Expression` to add to the node's - /// `expressions` collection. - /// - returns: A copy of the receiver with the provided `Expression` - /// appended to its `expressions` collection. - @available(*, deprecated, message: "Use node.expressions.append(newElement) instead") - public func addExpression(_ element: LabeledExprSyntax) -> ExpressionSegmentSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[7] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 7, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ExpressionSegmentSyntax.self) - } - public var unexpectedBetweenExpressionsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 8)?.cast(UnexpectedNodesSyntax.self) @@ -2299,33 +2029,6 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> ExtensionDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ExtensionDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -2345,33 +2048,6 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> ExtensionDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ExtensionDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndExtensionKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3262,33 +2938,6 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } - /// Adds the provided `element` to the node's `arguments` - /// collection. - /// - /// - param element: The new `Argument` to add to the node's - /// `arguments` collection. - /// - returns: A copy of the receiver with the provided `Argument` - /// appended to its `arguments` collection. - @available(*, deprecated, message: "Use node.arguments.append(newElement) instead") - public func addArgument(_ element: LabeledExprSyntax) -> FunctionCallExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(FunctionCallExprSyntax.self) - } - public var unexpectedBetweenArgumentsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -3346,33 +2995,6 @@ public struct FunctionCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafE } } - /// Adds the provided `element` to the node's `additionalTrailingClosures` - /// collection. - /// - /// - param element: The new `AdditionalTrailingClosure` to add to the node's - /// `additionalTrailingClosures` collection. - /// - returns: A copy of the receiver with the provided `AdditionalTrailingClosure` - /// appended to its `additionalTrailingClosures` collection. - @available(*, deprecated, message: "Use node.additionalTrailingClosures.append(newElement) instead") - public func addAdditionalTrailingClosure(_ element: MultipleTrailingClosureElementSyntax) -> FunctionCallExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[11] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.multipleTrailingClosureElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 11, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(FunctionCallExprSyntax.self) - } - public var unexpectedAfterAdditionalTrailingClosures: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 12)?.cast(UnexpectedNodesSyntax.self) @@ -3548,33 +3170,6 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> FunctionDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(FunctionDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -3594,33 +3189,6 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> FunctionDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(FunctionDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndFuncKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4016,33 +3584,6 @@ public struct FunctionParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Le } } - /// Adds the provided `element` to the node's `parameters` - /// collection. - /// - /// - param element: The new `Parameter` to add to the node's - /// `parameters` collection. - /// - returns: A copy of the receiver with the provided `Parameter` - /// appended to its `parameters` collection. - @available(*, deprecated, message: "Use node.parameters.append(newElement) instead") - public func addParameter(_ element: FunctionParameterSyntax) -> FunctionParameterClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.functionParameterList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(FunctionParameterClauseSyntax.self) - } - public var unexpectedBetweenParametersAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4227,33 +3768,6 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> FunctionParameterSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(FunctionParameterSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -4273,33 +3787,6 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> FunctionParameterSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(FunctionParameterSyntax.self) - } - public var unexpectedBetweenModifiersAndFirstName: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4764,33 +4251,6 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeS } } - /// Adds the provided `element` to the node's `parameters` - /// collection. - /// - /// - param element: The new `Parameter` to add to the node's - /// `parameters` collection. - /// - returns: A copy of the receiver with the provided `Parameter` - /// appended to its `parameters` collection. - @available(*, deprecated, message: "Use node.parameters.append(newElement) instead") - public func addParameter(_ element: TupleTypeElementSyntax) -> FunctionTypeSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.tupleTypeElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(FunctionTypeSyntax.self) - } - public var unexpectedBetweenParametersAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift index 321adc489d2..017fc516d57 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift @@ -127,33 +127,6 @@ public struct GenericArgumentClauseSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } - /// Adds the provided `element` to the node's `arguments` - /// collection. - /// - /// - param element: The new `Argument` to add to the node's - /// `arguments` collection. - /// - returns: A copy of the receiver with the provided `Argument` - /// appended to its `arguments` collection. - @available(*, deprecated, message: "Use node.arguments.append(newElement) instead") - public func addArgument(_ element: GenericArgumentSyntax) -> GenericArgumentClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.genericArgumentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(GenericArgumentClauseSyntax.self) - } - public var unexpectedBetweenArgumentsAndRightAngle: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -543,33 +516,6 @@ public struct GenericParameterClauseSyntax: SyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `parameters` - /// collection. - /// - /// - param element: The new `Parameter` to add to the node's - /// `parameters` collection. - /// - returns: A copy of the receiver with the provided `Parameter` - /// appended to its `parameters` collection. - @available(*, deprecated, message: "Use node.parameters.append(newElement) instead") - public func addParameter(_ element: GenericParameterSyntax) -> GenericParameterClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.genericParameterList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(GenericParameterClauseSyntax.self) - } - public var unexpectedBetweenParametersAndGenericWhereClause: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -744,33 +690,6 @@ public struct GenericParameterSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynta } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> GenericParameterSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(GenericParameterSyntax.self) - } - public var unexpectedBetweenAttributesAndSpecifier: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -1371,33 +1290,6 @@ public struct GenericWhereClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyn } } - /// Adds the provided `element` to the node's `requirements` - /// collection. - /// - /// - param element: The new `Requirement` to add to the node's - /// `requirements` collection. - /// - returns: A copy of the receiver with the provided `Requirement` - /// appended to its `requirements` collection. - @available(*, deprecated, message: "Use node.requirements.append(newElement) instead") - public func addRequirement(_ element: GenericRequirementSyntax) -> GenericWhereClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.genericRequirementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(GenericWhereClauseSyntax.self) - } - public var unexpectedAfterRequirements: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1529,33 +1421,6 @@ public struct GuardStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } - /// Adds the provided `element` to the node's `conditions` - /// collection. - /// - /// - param element: The new `Condition` to add to the node's - /// `conditions` collection. - /// - returns: A copy of the receiver with the provided `Condition` - /// appended to its `conditions` collection. - @available(*, deprecated, message: "Use node.conditions.append(newElement) instead") - public func addCondition(_ element: ConditionElementSyntax) -> GuardStmtSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.conditionElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(GuardStmtSyntax.self) - } - public var unexpectedBetweenConditionsAndElseKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -2246,33 +2111,6 @@ public struct IfConfigDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `clauses` - /// collection. - /// - /// - param element: The new `Clause` to add to the node's - /// `clauses` collection. - /// - returns: A copy of the receiver with the provided `Clause` - /// appended to its `clauses` collection. - @available(*, deprecated, message: "Use node.clauses.append(newElement) instead") - public func addClause(_ element: IfConfigClauseSyntax) -> IfConfigDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.ifConfigClauseList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(IfConfigDeclSyntax.self) - } - public var unexpectedBetweenClausesAndPoundEndif: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -2516,33 +2354,6 @@ public struct IfExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyntaxN } } - /// Adds the provided `element` to the node's `conditions` - /// collection. - /// - /// - param element: The new `Condition` to add to the node's - /// `conditions` collection. - /// - returns: A copy of the receiver with the provided `Condition` - /// appended to its `conditions` collection. - @available(*, deprecated, message: "Use node.conditions.append(newElement) instead") - public func addCondition(_ element: ConditionElementSyntax) -> IfExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.conditionElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(IfExprSyntax.self) - } - public var unexpectedBetweenConditionsAndBody: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3011,33 +2822,6 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> ImportDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ImportDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -3057,33 +2841,6 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> ImportDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ImportDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndImportKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3160,33 +2917,6 @@ public struct ImportDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn } } - /// Adds the provided `element` to the node's `path` - /// collection. - /// - /// - param element: The new `PathComponent` to add to the node's - /// `path` collection. - /// - returns: A copy of the receiver with the provided `PathComponent` - /// appended to its `path` collection. - @available(*, deprecated, message: "Use node.path.append(newElement) instead") - public func addPathComponent(_ element: ImportPathComponentSyntax) -> ImportDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[9] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.importPathComponentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 9, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ImportDeclSyntax.self) - } - public var unexpectedAfterPath: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 10)?.cast(UnexpectedNodesSyntax.self) @@ -3714,33 +3444,6 @@ public struct InheritanceClauseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSynt } } - /// Adds the provided `element` to the node's `inheritedTypes` - /// collection. - /// - /// - param element: The new `InheritedType` to add to the node's - /// `inheritedTypes` collection. - /// - returns: A copy of the receiver with the provided `InheritedType` - /// appended to its `inheritedTypes` collection. - @available(*, deprecated, message: "Use node.inheritedTypes.append(newElement) instead") - public func addInheritedType(_ element: InheritedTypeSyntax) -> InheritanceClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.inheritedTypeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(InheritanceClauseSyntax.self) - } - public var unexpectedAfterInheritedTypes: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4148,33 +3851,6 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> InitializerDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(InitializerDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -4194,33 +3870,6 @@ public struct InitializerDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDe } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> InitializerDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(InitializerDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndInitKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift index 3c49ca82268..8b55c8a6489 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift @@ -378,33 +378,6 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSy } } - /// Adds the provided `element` to the node's `components` - /// collection. - /// - /// - param element: The new `KeyPathComponent` to add to the node's - /// `components` collection. - /// - returns: A copy of the receiver with the provided `KeyPathComponent` - /// appended to its `components` collection. - @available(*, deprecated, message: "Use node.components.append(newElement) instead") - public func addKeyPathComponent(_ element: KeyPathComponentSyntax) -> KeyPathExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.keyPathComponentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(KeyPathExprSyntax.self) - } - public var unexpectedAfterComponents: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -743,33 +716,6 @@ public struct KeyPathSubscriptComponentSyntax: SyntaxProtocol, SyntaxHashable, _ } } - /// Adds the provided `element` to the node's `arguments` - /// collection. - /// - /// - param element: The new `Argument` to add to the node's - /// `arguments` collection. - /// - returns: A copy of the receiver with the provided `Argument` - /// appended to its `arguments` collection. - @available(*, deprecated, message: "Use node.arguments.append(newElement) instead") - public func addArgument(_ element: LabeledExprSyntax) -> KeyPathSubscriptComponentSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(KeyPathSubscriptComponentSyntax.self) - } - public var unexpectedBetweenArgumentsAndRightSquare: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1975,33 +1921,6 @@ public struct LifetimeTypeSpecifierSyntax: SyntaxProtocol, SyntaxHashable, _Leaf } } - /// Adds the provided `element` to the node's `arguments` - /// collection. - /// - /// - param element: The new `Arguments` to add to the node's - /// `arguments` collection. - /// - returns: A copy of the receiver with the provided `Arguments` - /// appended to its `arguments` collection. - @available(*, deprecated, message: "Use node.arguments.append(newElement) instead") - public func addArguments(_ element: LifetimeSpecifierArgumentSyntax) -> LifetimeTypeSpecifierSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[7] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.lifetimeSpecifierArgumentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 7, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(LifetimeTypeSpecifierSyntax.self) - } - public var unexpectedBetweenArgumentsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 8)?.cast(UnexpectedNodesSyntax.self) @@ -2169,33 +2088,6 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> MacroDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MacroDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -2214,33 +2106,6 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSynt } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> MacroDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MacroDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndMacroKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -2524,33 +2389,6 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> MacroExpansionDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MacroExpansionDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -2569,33 +2407,6 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> MacroExpansionDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MacroExpansionDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndPound: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -2697,33 +2508,6 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `arguments` - /// collection. - /// - /// - param element: The new `Argument` to add to the node's - /// `arguments` collection. - /// - returns: A copy of the receiver with the provided `Argument` - /// appended to its `arguments` collection. - @available(*, deprecated, message: "Use node.arguments.append(newElement) instead") - public func addArgument(_ element: LabeledExprSyntax) -> MacroExpansionDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[13] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 13, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MacroExpansionDeclSyntax.self) - } - public var unexpectedBetweenArgumentsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 14)?.cast(UnexpectedNodesSyntax.self) @@ -2781,33 +2565,6 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `additionalTrailingClosures` - /// collection. - /// - /// - param element: The new `AdditionalTrailingClosure` to add to the node's - /// `additionalTrailingClosures` collection. - /// - returns: A copy of the receiver with the provided `AdditionalTrailingClosure` - /// appended to its `additionalTrailingClosures` collection. - @available(*, deprecated, message: "Use node.additionalTrailingClosures.append(newElement) instead") - public func addAdditionalTrailingClosure(_ element: MultipleTrailingClosureElementSyntax) -> MacroExpansionDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[19] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.multipleTrailingClosureElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 19, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MacroExpansionDeclSyntax.self) - } - public var unexpectedAfterAdditionalTrailingClosures: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 20)?.cast(UnexpectedNodesSyntax.self) @@ -3048,33 +2805,6 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `arguments` - /// collection. - /// - /// - param element: The new `Argument` to add to the node's - /// `arguments` collection. - /// - returns: A copy of the receiver with the provided `Argument` - /// appended to its `arguments` collection. - @available(*, deprecated, message: "Use node.arguments.append(newElement) instead") - public func addArgument(_ element: LabeledExprSyntax) -> MacroExpansionExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[9] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 9, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MacroExpansionExprSyntax.self) - } - public var unexpectedBetweenArgumentsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 10)?.cast(UnexpectedNodesSyntax.self) @@ -3132,33 +2862,6 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Lea } } - /// Adds the provided `element` to the node's `additionalTrailingClosures` - /// collection. - /// - /// - param element: The new `AdditionalTrailingClosure` to add to the node's - /// `additionalTrailingClosures` collection. - /// - returns: A copy of the receiver with the provided `AdditionalTrailingClosure` - /// appended to its `additionalTrailingClosures` collection. - @available(*, deprecated, message: "Use node.additionalTrailingClosures.append(newElement) instead") - public func addAdditionalTrailingClosure(_ element: MultipleTrailingClosureElementSyntax) -> MacroExpansionExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[15] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.multipleTrailingClosureElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 15, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MacroExpansionExprSyntax.self) - } - public var unexpectedAfterAdditionalTrailingClosures: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 16)?.cast(UnexpectedNodesSyntax.self) @@ -3877,33 +3580,6 @@ public struct MemberBlockSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode } } - /// Adds the provided `element` to the node's `members` - /// collection. - /// - /// - param element: The new `Member` to add to the node's - /// `members` collection. - /// - returns: A copy of the receiver with the provided `Member` - /// appended to its `members` collection. - @available(*, deprecated, message: "Use node.members.append(newElement) instead") - public func addMember(_ element: MemberBlockItemSyntax) -> MemberBlockSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.memberBlockItemList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MemberBlockSyntax.self) - } - public var unexpectedBetweenMembersAndRightBrace: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4361,33 +4037,6 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> MissingDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MissingDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -4407,33 +4056,6 @@ public struct MissingDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSy } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> MissingDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(MissingDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndPlaceholder: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift index dd6ee8f30e2..d413be5463c 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift @@ -626,33 +626,6 @@ public struct OperatorPrecedenceAndTypesSyntax: SyntaxProtocol, SyntaxHashable, } } - /// Adds the provided `element` to the node's `designatedTypes` - /// collection. - /// - /// - param element: The new `DesignatedTypeElement` to add to the node's - /// `designatedTypes` collection. - /// - returns: A copy of the receiver with the provided `DesignatedTypeElement` - /// appended to its `designatedTypes` collection. - @available(*, deprecated, message: "Use node.designatedTypes.append(newElement) instead") - public func addDesignatedTypeElement(_ element: DesignatedTypeSyntax) -> OperatorPrecedenceAndTypesSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.designatedTypeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(OperatorPrecedenceAndTypesSyntax.self) - } - public var unexpectedAfterDesignatedTypes: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -1274,33 +1247,6 @@ public struct OriginallyDefinedInAttributeArgumentsSyntax: SyntaxProtocol, Synta } } - /// Adds the provided `element` to the node's `platforms` - /// collection. - /// - /// - param element: The new `Platform` to add to the node's - /// `platforms` collection. - /// - returns: A copy of the receiver with the provided `Platform` - /// appended to its `platforms` collection. - @available(*, deprecated, message: "Use node.platforms.append(newElement) instead") - public func addPlatform(_ element: PlatformVersionItemSyntax) -> OriginallyDefinedInAttributeArgumentsSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[9] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.platformVersionItemList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 9, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(OriginallyDefinedInAttributeArgumentsSyntax.self) - } - public var unexpectedAfterPlatforms: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 10)?.cast(UnexpectedNodesSyntax.self) @@ -3479,33 +3425,6 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> PrecedenceGroupDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(PrecedenceGroupDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -3525,33 +3444,6 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> PrecedenceGroupDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(PrecedenceGroupDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndPrecedencegroupKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3636,33 +3528,6 @@ public struct PrecedenceGroupDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _Le } } - /// Adds the provided `element` to the node's `groupAttributes` - /// collection. - /// - /// - param element: The new `GroupAttribute` to add to the node's - /// `groupAttributes` collection. - /// - returns: A copy of the receiver with the provided `GroupAttribute` - /// appended to its `groupAttributes` collection. - @available(*, deprecated, message: "Use node.groupAttributes.append(newElement) instead") - public func addGroupAttribute(_ element: Syntax) -> PrecedenceGroupDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[11] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.precedenceGroupAttributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 11, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(PrecedenceGroupDeclSyntax.self) - } - public var unexpectedBetweenGroupAttributesAndRightBrace: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 12)?.cast(UnexpectedNodesSyntax.self) @@ -3976,33 +3841,6 @@ public struct PrecedenceGroupRelationSyntax: SyntaxProtocol, SyntaxHashable, _Le } } - /// Adds the provided `element` to the node's `precedenceGroups` - /// collection. - /// - /// - param element: The new `OtherName` to add to the node's - /// `precedenceGroups` collection. - /// - returns: A copy of the receiver with the provided `OtherName` - /// appended to its `precedenceGroups` collection. - @available(*, deprecated, message: "Use node.precedenceGroups.append(newElement) instead") - public func addOtherName(_ element: PrecedenceGroupNameSyntax) -> PrecedenceGroupRelationSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.precedenceGroupNameList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(PrecedenceGroupRelationSyntax.self) - } - public var unexpectedAfterPrecedenceGroups: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -4262,33 +4100,6 @@ public struct PrimaryAssociatedTypeClauseSyntax: SyntaxProtocol, SyntaxHashable, } } - /// Adds the provided `element` to the node's `primaryAssociatedTypes` - /// collection. - /// - /// - param element: The new `PrimaryAssociatedType` to add to the node's - /// `primaryAssociatedTypes` collection. - /// - returns: A copy of the receiver with the provided `PrimaryAssociatedType` - /// appended to its `primaryAssociatedTypes` collection. - @available(*, deprecated, message: "Use node.primaryAssociatedTypes.append(newElement) instead") - public func addPrimaryAssociatedType(_ element: PrimaryAssociatedTypeSyntax) -> PrimaryAssociatedTypeClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.primaryAssociatedTypeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(PrimaryAssociatedTypeClauseSyntax.self) - } - public var unexpectedBetweenPrimaryAssociatedTypesAndRightAngle: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4593,33 +4404,6 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> ProtocolDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ProtocolDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -4639,33 +4423,6 @@ public struct ProtocolDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> ProtocolDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(ProtocolDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndProtocolKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift index 39f92c444ca..80354c47b8e 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift @@ -1048,33 +1048,6 @@ public struct SequenceExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprS } } - /// Adds the provided `element` to the node's `elements` - /// collection. - /// - /// - param element: The new `Element` to add to the node's - /// `elements` collection. - /// - returns: A copy of the receiver with the provided `Element` - /// appended to its `elements` collection. - @available(*, deprecated, message: "Use node.elements.append(newElement) instead") - public func addElement(_ element: ExprSyntax) -> SequenceExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.exprList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SequenceExprSyntax.self) - } - public var unexpectedAfterElements: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -1208,33 +1181,6 @@ public struct SimpleStringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, } } - /// Adds the provided `element` to the node's `segments` - /// collection. - /// - /// - param element: The new `Segment` to add to the node's - /// `segments` collection. - /// - returns: A copy of the receiver with the provided `Segment` - /// appended to its `segments` collection. - @available(*, deprecated, message: "Use node.segments.append(newElement) instead") - public func addSegment(_ element: StringSegmentSyntax) -> SimpleStringLiteralExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.simpleStringLiteralSegmentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SimpleStringLiteralExprSyntax.self) - } - public var unexpectedBetweenSegmentsAndClosingQuote: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1603,33 +1549,6 @@ public struct SourceFileSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP } } - /// Adds the provided `element` to the node's `statements` - /// collection. - /// - /// - param element: The new `Statement` to add to the node's - /// `statements` collection. - /// - returns: A copy of the receiver with the provided `Statement` - /// appended to its `statements` collection. - @available(*, deprecated, message: "Use node.statements.append(newElement) instead") - public func addStatement(_ element: CodeBlockItemSyntax) -> SourceFileSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.codeBlockItemList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SourceFileSyntax.self) - } - public var unexpectedBetweenStatementsAndEndOfFileToken: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1817,33 +1736,6 @@ public struct SpecializeAvailabilityArgumentSyntax: SyntaxProtocol, SyntaxHashab } } - /// Adds the provided `element` to the node's `availabilityArguments` - /// collection. - /// - /// - param element: The new `AvailabilityArgument` to add to the node's - /// `availabilityArguments` collection. - /// - returns: A copy of the receiver with the provided `AvailabilityArgument` - /// appended to its `availabilityArguments` collection. - @available(*, deprecated, message: "Use node.availabilityArguments.append(newElement) instead") - public func addAvailabilityArgument(_ element: AvailabilityArgumentSyntax) -> SpecializeAvailabilityArgumentSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.availabilityArgumentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SpecializeAvailabilityArgumentSyntax.self) - } - public var unexpectedBetweenAvailabilityArgumentsAndSemicolon: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -2244,33 +2136,6 @@ public struct StringLiteralExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } - /// Adds the provided `element` to the node's `segments` - /// collection. - /// - /// - param element: The new `Segment` to add to the node's - /// `segments` collection. - /// - returns: A copy of the receiver with the provided `Segment` - /// appended to its `segments` collection. - @available(*, deprecated, message: "Use node.segments.append(newElement) instead") - public func addSegment(_ element: Syntax) -> StringLiteralExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.stringLiteralSegmentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(StringLiteralExprSyntax.self) - } - public var unexpectedBetweenSegmentsAndClosingQuote: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -2614,33 +2479,6 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> StructDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(StructDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -2660,33 +2498,6 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclSyn } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> StructDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(StructDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndStructKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -2984,33 +2795,6 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } - /// Adds the provided `element` to the node's `arguments` - /// collection. - /// - /// - param element: The new `Argument` to add to the node's - /// `arguments` collection. - /// - returns: A copy of the receiver with the provided `Argument` - /// appended to its `arguments` collection. - @available(*, deprecated, message: "Use node.arguments.append(newElement) instead") - public func addArgument(_ element: LabeledExprSyntax) -> SubscriptCallExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SubscriptCallExprSyntax.self) - } - public var unexpectedBetweenArgumentsAndRightSquare: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -3068,33 +2852,6 @@ public struct SubscriptCallExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _Leaf } } - /// Adds the provided `element` to the node's `additionalTrailingClosures` - /// collection. - /// - /// - param element: The new `AdditionalTrailingClosure` to add to the node's - /// `additionalTrailingClosures` collection. - /// - returns: A copy of the receiver with the provided `AdditionalTrailingClosure` - /// appended to its `additionalTrailingClosures` collection. - @available(*, deprecated, message: "Use node.additionalTrailingClosures.append(newElement) instead") - public func addAdditionalTrailingClosure(_ element: MultipleTrailingClosureElementSyntax) -> SubscriptCallExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[11] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.multipleTrailingClosureElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 11, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SubscriptCallExprSyntax.self) - } - public var unexpectedAfterAdditionalTrailingClosures: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 12)?.cast(UnexpectedNodesSyntax.self) @@ -3243,33 +3000,6 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> SubscriptDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SubscriptDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -3288,33 +3018,6 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> SubscriptDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SubscriptDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndSubscriptKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3911,33 +3614,6 @@ public struct SwitchCaseLabelSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntax } } - /// Adds the provided `element` to the node's `caseItems` - /// collection. - /// - /// - param element: The new `CaseItem` to add to the node's - /// `caseItems` collection. - /// - returns: A copy of the receiver with the provided `CaseItem` - /// appended to its `caseItems` collection. - @available(*, deprecated, message: "Use node.caseItems.append(newElement) instead") - public func addCaseItem(_ element: SwitchCaseItemSyntax) -> SwitchCaseLabelSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.switchCaseItemList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SwitchCaseLabelSyntax.self) - } - public var unexpectedBetweenCaseItemsAndColon: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4186,33 +3862,6 @@ public struct SwitchCaseSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNodeP } } - /// Adds the provided `element` to the node's `statements` - /// collection. - /// - /// - param element: The new `Statement` to add to the node's - /// `statements` collection. - /// - returns: A copy of the receiver with the provided `Statement` - /// appended to its `statements` collection. - @available(*, deprecated, message: "Use node.statements.append(newElement) instead") - public func addStatement(_ element: CodeBlockItemSyntax) -> SwitchCaseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[5] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.codeBlockItemList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 5, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SwitchCaseSyntax.self) - } - public var unexpectedAfterStatements: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 6)?.cast(UnexpectedNodesSyntax.self) @@ -4540,33 +4189,6 @@ public struct SwitchExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSyn } } - /// Adds the provided `element` to the node's `cases` - /// collection. - /// - /// - param element: The new `Case` to add to the node's - /// `cases` collection. - /// - returns: A copy of the receiver with the provided `Case` - /// appended to its `cases` collection. - @available(*, deprecated, message: "Use node.cases.append(newElement) instead") - public func addCase(_ element: Syntax) -> SwitchExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[7] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.switchCaseList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 7, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(SwitchExprSyntax.self) - } - public var unexpectedBetweenCasesAndRightBrace: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 8)?.cast(UnexpectedNodesSyntax.self) diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift index 86dde405b86..178dc967339 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift @@ -937,33 +937,6 @@ public struct TupleExprSyntax: ExprSyntaxProtocol, SyntaxHashable, _LeafExprSynt } } - /// Adds the provided `element` to the node's `elements` - /// collection. - /// - /// - param element: The new `Element` to add to the node's - /// `elements` collection. - /// - returns: A copy of the receiver with the provided `Element` - /// appended to its `elements` collection. - @available(*, deprecated, message: "Use node.elements.append(newElement) instead") - public func addElement(_ element: LabeledExprSyntax) -> TupleExprSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.labeledExprList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(TupleExprSyntax.self) - } - public var unexpectedBetweenElementsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1320,33 +1293,6 @@ public struct TuplePatternSyntax: PatternSyntaxProtocol, SyntaxHashable, _LeafPa } } - /// Adds the provided `element` to the node's `elements` - /// collection. - /// - /// - param element: The new `Element` to add to the node's - /// `elements` collection. - /// - returns: A copy of the receiver with the provided `Element` - /// appended to its `elements` collection. - @available(*, deprecated, message: "Use node.elements.append(newElement) instead") - public func addElement(_ element: TuplePatternElementSyntax) -> TuplePatternSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.tuplePatternElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(TuplePatternSyntax.self) - } - public var unexpectedBetweenElementsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1771,33 +1717,6 @@ public struct TupleTypeSyntax: TypeSyntaxProtocol, SyntaxHashable, _LeafTypeSynt } } - /// Adds the provided `element` to the node's `elements` - /// collection. - /// - /// - param element: The new `Element` to add to the node's - /// `elements` collection. - /// - returns: A copy of the receiver with the provided `Element` - /// appended to its `elements` collection. - @available(*, deprecated, message: "Use node.elements.append(newElement) instead") - public func addElement(_ element: TupleTypeElementSyntax) -> TupleTypeSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.tupleTypeElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(TupleTypeSyntax.self) - } - public var unexpectedBetweenElementsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -1954,33 +1873,6 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> TypeAliasDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(TypeAliasDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -1999,33 +1891,6 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDecl } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> TypeAliasDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(TypeAliasDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndTypealiasKeyword: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3614,33 +3479,6 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `attributes` - /// collection. - /// - /// - param element: The new `Attribute` to add to the node's - /// `attributes` collection. - /// - returns: A copy of the receiver with the provided `Attribute` - /// appended to its `attributes` collection. - @available(*, deprecated, message: "Use node.attributes.append(newElement) instead") - public func addAttribute(_ element: Syntax) -> VariableDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[1] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.attributeList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 1, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(VariableDeclSyntax.self) - } - public var unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 2)?.cast(UnexpectedNodesSyntax.self) @@ -3660,33 +3498,6 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `modifiers` - /// collection. - /// - /// - param element: The new `Modifier` to add to the node's - /// `modifiers` collection. - /// - returns: A copy of the receiver with the provided `Modifier` - /// appended to its `modifiers` collection. - @available(*, deprecated, message: "Use node.modifiers.append(newElement) instead") - public func addModifier(_ element: DeclModifierSyntax) -> VariableDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.declModifierList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(VariableDeclSyntax.self) - } - public var unexpectedBetweenModifiersAndBindingSpecifier: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -3745,33 +3556,6 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable, _LeafDeclS } } - /// Adds the provided `element` to the node's `bindings` - /// collection. - /// - /// - param element: The new `Binding` to add to the node's - /// `bindings` collection. - /// - returns: A copy of the receiver with the provided `Binding` - /// appended to its `bindings` collection. - @available(*, deprecated, message: "Use node.bindings.append(newElement) instead") - public func addBinding(_ element: PatternBindingSyntax) -> VariableDeclSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[7] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.patternBindingList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 7, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(VariableDeclSyntax.self) - } - public var unexpectedAfterBindings: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 8)?.cast(UnexpectedNodesSyntax.self) @@ -4037,33 +3821,6 @@ public struct VersionTupleSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNod } } - /// Adds the provided `element` to the node's `components` - /// collection. - /// - /// - param element: The new `VersionComponent` to add to the node's - /// `components` collection. - /// - returns: A copy of the receiver with the provided `VersionComponent` - /// appended to its `components` collection. - @available(*, deprecated, message: "Use node.components.append(newElement) instead") - public func addVersionComponent(_ element: VersionComponentSyntax) -> VersionTupleSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.versionComponentList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(VersionTupleSyntax.self) - } - public var unexpectedAfterComponents: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4311,33 +4068,6 @@ public struct WhileStmtSyntax: StmtSyntaxProtocol, SyntaxHashable, _LeafStmtSynt } } - /// Adds the provided `element` to the node's `conditions` - /// collection. - /// - /// - param element: The new `Condition` to add to the node's - /// `conditions` collection. - /// - returns: A copy of the receiver with the provided `Condition` - /// appended to its `conditions` collection. - @available(*, deprecated, message: "Use node.conditions.append(newElement) instead") - public func addCondition(_ element: ConditionElementSyntax) -> WhileStmtSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.conditionElementList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(WhileStmtSyntax.self) - } - public var unexpectedBetweenConditionsAndBody: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self) @@ -4895,33 +4625,6 @@ public struct YieldedExpressionsClauseSyntax: SyntaxProtocol, SyntaxHashable, _L } } - /// Adds the provided `element` to the node's `elements` - /// collection. - /// - /// - param element: The new `Element` to add to the node's - /// `elements` collection. - /// - returns: A copy of the receiver with the provided `Element` - /// appended to its `elements` collection. - @available(*, deprecated, message: "Use node.elements.append(newElement) instead") - public func addElement(_ element: YieldedExpressionSyntax) -> YieldedExpressionsClauseSyntax { - var collection: RawSyntax - let arena = RawSyntaxArena() - if let col = raw.layoutView!.children[3] { - collection = col.layoutView!.appending(element.raw, arena: arena) - } else { - collection = RawSyntax.makeLayout(kind: SyntaxKind.yieldedExpressionList, - from: [element.raw], arena: arena) - } - return Syntax(self) - .replacingChild( - at: 3, - with: collection, - rawNodeArena: arena, - rawAllocationArena: arena - ) - .cast(YieldedExpressionsClauseSyntax.self) - } - public var unexpectedBetweenElementsAndRightParen: UnexpectedNodesSyntax? { get { return Syntax(self).child(at: 4)?.cast(UnexpectedNodesSyntax.self)