diff --git a/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift b/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift index c63c34296f8..e3adc88d1dd 100644 --- a/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift @@ -302,7 +302,8 @@ public let ATTRIBUTE_NODES: [Node] = [ nameForDiagnostics: "declaration name", children: [ Child( - name: "DeclBaseName", + name: "BaseName", + deprecatedName: "DeclBaseName", kind: .token(choices: [ .token(tokenKind: "IdentifierToken"), .token(tokenKind: "BinaryOperatorToken"), @@ -314,7 +315,8 @@ public let ATTRIBUTE_NODES: [Node] = [ documentation: "The base name of the protocol's requirement." ), Child( - name: "DeclNameArguments", + name: "Arguments", + deprecatedName: "DeclNameArguments", kind: .node(kind: .declNameArguments), nameForDiagnostics: "arguments", documentation: "The argument labels of the protocol's requirement if it is a function requirement.", @@ -505,7 +507,8 @@ public let ATTRIBUTE_NODES: [Node] = [ isOptional: true ), Child( - name: "WhereClause", + name: "GenericWhereClause", + deprecatedName: "WhereClause", kind: .node(kind: .genericWhereClause), isOptional: true ), diff --git a/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift b/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift index 21bfcf24d75..c5584ea9a68 100644 --- a/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift @@ -1087,7 +1087,8 @@ public let DECL_NODES: [Node] = [ nameForDiagnostics: "function signature", children: [ Child( - name: "Input", + name: "ParameterClause", + deprecatedName: "Input", kind: .node(kind: .parameterClause) ), Child( @@ -1096,7 +1097,8 @@ public let DECL_NODES: [Node] = [ isOptional: true ), Child( - name: "Output", + name: "ReturnClause", + deprecatedName: "Output", kind: .node(kind: .returnClause), isOptional: true ), @@ -1449,7 +1451,8 @@ public let DECL_NODES: [Node] = [ kind: .token(choices: [.token(tokenKind: "IdentifierToken")]) ), Child( - name: "GenericArguments", + name: "GenericArgumentClause", + deprecatedName: "GenericArguments", kind: .node(kind: .genericArgumentClause), isOptional: true ), @@ -2214,11 +2217,13 @@ public let DECL_NODES: [Node] = [ isOptional: true ), Child( - name: "Indices", + name: "ParameterClause", + deprecatedName: "Indices", kind: .node(kind: .parameterClause) ), Child( - name: "Result", + name: "ReturnClause", + deprecatedName: "Result", kind: .node(kind: .returnClause) ), Child( diff --git a/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift b/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift index db646cc53bd..c1a235e44ab 100644 --- a/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift @@ -240,7 +240,8 @@ public let EXPR_NODES: [Node] = [ kind: .token(choices: [.token(tokenKind: "ColonToken")]) ), Child( - name: "VersionTuple", + name: "Version", + deprecatedName: "VersionTuple", kind: .node(kind: .versionTuple) ), ] @@ -536,14 +537,16 @@ public let EXPR_NODES: [Node] = [ isOptional: true ), Child( - name: "Input", + name: "ParameterClause", + deprecatedName: "Input", kind: .nodeChoices(choices: [ Child( name: "SimpleInput", kind: .node(kind: .closureParamList) ), Child( - name: "Input", + name: "ParameterClause", + deprecatedName: "Input", kind: .node(kind: .closureParameterClause) ), ]), @@ -555,7 +558,8 @@ public let EXPR_NODES: [Node] = [ isOptional: true ), Child( - name: "Output", + name: "ReturnClause", + deprecatedName: "Output", kind: .node(kind: .returnClause), isOptional: true ), @@ -1154,7 +1158,8 @@ public let EXPR_NODES: [Node] = [ kind: .token(choices: [.token(tokenKind: "IdentifierToken")]) ), Child( - name: "GenericArguments", + name: "GenericArgumentClause", + deprecatedName: "GenericArguments", kind: .node(kind: .genericArgumentClause), isOptional: true ), diff --git a/CodeGeneration/Sources/SyntaxSupport/Traits.swift b/CodeGeneration/Sources/SyntaxSupport/Traits.swift index c0ace6b9e3e..b74a5535845 100644 --- a/CodeGeneration/Sources/SyntaxSupport/Traits.swift +++ b/CodeGeneration/Sources/SyntaxSupport/Traits.swift @@ -55,7 +55,7 @@ public let TRAITS: [Trait] = [ children: [ Child(name: "PoundToken", kind: .token(choices: [.token(tokenKind: "PoundToken")])), Child(name: "Macro", kind: .token(choices: [.token(tokenKind: "IdentifierToken")])), - Child(name: "GenericArguments", kind: .node(kind: .genericArgumentClause), isOptional: true), + Child(name: "GenericArgumentClause", kind: .node(kind: .genericArgumentClause), isOptional: true), Child(name: "LeftParen", kind: .token(choices: [.token(tokenKind: "LeftParenToken")]), isOptional: true), Child(name: "ArgumentList", kind: .node(kind: .tupleExprElementList)), Child(name: "RightParen", kind: .token(choices: [.token(tokenKind: "RightParenToken")]), isOptional: true), diff --git a/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift b/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift index d1f1360fa11..7a5d9a799ff 100644 --- a/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift +++ b/CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift @@ -202,7 +202,8 @@ public let TYPE_NODES: [Node] = [ isOptional: true ), Child( - name: "Output", + name: "ReturnClause", + deprecatedName: "Output", kind: .node(kind: .returnClause) ), ] diff --git a/CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntax/SyntaxNodesFile.swift b/CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntax/SyntaxNodesFile.swift index e46d5a0f5e7..ca8e661c3cd 100644 --- a/CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntax/SyntaxNodesFile.swift +++ b/CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntax/SyntaxNodesFile.swift @@ -91,7 +91,7 @@ func syntaxNode(emitKind: SyntaxNodeKind) -> SourceFileSyntax { } let closureSignature = ClosureSignatureSyntax( - input: .input( + parameterClause: .parameterClause( ClosureParameterClauseSyntax( parameterList: ClosureParameterListSyntax { ClosureParameterSyntax(firstName: .identifier("arena")) @@ -105,7 +105,7 @@ func syntaxNode(emitKind: SyntaxNodeKind) -> SourceFileSyntax { ArrayElementSyntax( expression: MemberAccessExprSyntax( base: child.type.optionalChained(expr: ExprSyntax("\(raw: child.varName.backtickedIfNeeded)")), - dot: .periodToken(), + period: .periodToken(), name: "raw" ) ) @@ -169,7 +169,7 @@ func syntaxNode(emitKind: SyntaxNodeKind) -> SourceFileSyntax { public var \(raw: child.varName.backtickedIfNeeded): \(type) """ ) { - AccessorDeclSyntax(accessorKind: .keyword(.get)) { + AccessorDeclSyntax(accessorSpecifier: .keyword(.get)) { if child.isOptional { StmtSyntax("return data.child(at: \(raw: index), parent: Syntax(self)).map(\(raw: childType).init)") } else { diff --git a/CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntaxbuilder/RenamedChildrenBuilderCompatibilityFile.swift b/CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntaxbuilder/RenamedChildrenBuilderCompatibilityFile.swift index b4333b81558..b1a6426b8c2 100644 --- a/CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntaxbuilder/RenamedChildrenBuilderCompatibilityFile.swift +++ b/CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntaxbuilder/RenamedChildrenBuilderCompatibilityFile.swift @@ -21,8 +21,8 @@ let renamedChildrenBuilderCompatibilityFile = try! SourceFileSyntax(leadingTrivi for layoutNode in SYNTAX_NODES.compactMap(\.layoutNode).filter({ $0.children.hasDeprecatedChild }) { if let convenienceInit = try layoutNode.createConvenienceBuilerInitializer(useDeprecatedChildName: true) { let deprecatedNames = layoutNode.children - .filter { !$0.isUnexpectedNodes } - .compactMap { $0.deprecatedName?.withFirstCharacterLowercased } + .filter { !$0.isUnexpectedNodes && $0.deprecatedName != nil } + .compactMap { $0.varName } .joined(separator: ", ") DeclSyntax( diff --git a/CodeGeneration/Tests/ValidateSyntaxNodes/ValidateSyntaxNodes.swift b/CodeGeneration/Tests/ValidateSyntaxNodes/ValidateSyntaxNodes.swift index b19e0114864..18b70082404 100644 --- a/CodeGeneration/Tests/ValidateSyntaxNodes/ValidateSyntaxNodes.swift +++ b/CodeGeneration/Tests/ValidateSyntaxNodes/ValidateSyntaxNodes.swift @@ -90,6 +90,22 @@ fileprivate extension Child { } } +fileprivate extension Array where Element: Hashable, Element: Comparable { + /// Returns the element that occurs most frequently in the array. + /// + /// If there is a tie, returns the lexicographically first element. + /// + /// Returns `nil` if the array is empty. + var mostCommon: Element? { + var elementCounts: [Element: Int] = [:] + for element in self { + elementCounts[element, default: 0] += 1 + } + let maxCount = elementCounts.values.max() + return elementCounts.filter({ $0.value == maxCount }).map(\.key).sorted().first + } +} + class ValidateSyntaxNodes: XCTestCase { /// All nodes with base kind e.g. `ExprSyntax` should end with `ExprSyntax`. func testBaseKindSuffix() { @@ -395,17 +411,18 @@ class ValidateSyntaxNodes: XCTestCase { } } - for (kind, children) in childrenByNodeKind where !kind.isBase && kind != .token { + for (kind, children) in childrenByNodeKind where !kind.isBase && kind != .token && kind != .stringLiteralExpr { let childNames = children.map(\.child.name) - let firstChildName = childNames.first! + let mostCommonChildName = childNames.mostCommon! + let mostCommonChild = children.first(where: { $0.child.name == mostCommonChildName })! - for (node, child) in children.dropFirst() { - if child.name != firstChildName { + for (node, child) in children { + if child.name != mostCommonChildName { failures.append( ValidationFailure( node: node.kind, message: - "child '\(child.name)' is named inconsistently with '\(children.first!.node.kind.syntaxType).\(children.first!.child.name)', which has the same type ('\(kind.syntaxType)')" + "child '\(child.name)' is named inconsistently with '\(mostCommonChild.node.kind.syntaxType).\(mostCommonChildName)', which has the same type ('\(kind.syntaxType)')" ) ) } @@ -415,99 +432,45 @@ class ValidateSyntaxNodes: XCTestCase { assertFailuresMatchXFails( failures, expectedFailures: [ - ValidationFailure( - node: .differentiableAttributeArguments, - message: "child 'WhereClause' is named inconsistently with 'ActorDeclSyntax.GenericWhereClause', which has the same type ('GenericWhereClauseSyntax')" - ), - ValidationFailure( - node: .subscriptDecl, - message: "child 'Indices' is named inconsistently with 'FunctionSignatureSyntax.Input', which has the same type ('ParameterClauseSyntax')" - ), + // MARK: DeclNameArguments + // FIXME: IdentifierExprSyntax etc. should probably use DeclName as child instead of Name and Arguments ValidationFailure( node: .qualifiedDeclName, - message: "child 'Arguments' is named inconsistently with 'DeclNameSyntax.DeclNameArguments', which has the same type ('DeclNameArgumentsSyntax')" + message: + "child 'Arguments' is named inconsistently with 'IdentifierExprSyntax.DeclNameArguments', which has the same type ('DeclNameArgumentsSyntax')" ), ValidationFailure( - node: .macroExpansionDecl, + node: .declName, message: - "child 'GenericArguments' is named inconsistently with 'KeyPathPropertyComponentSyntax.GenericArgumentClause', which has the same type ('GenericArgumentClauseSyntax')" + "child 'Arguments' is named inconsistently with 'IdentifierExprSyntax.DeclNameArguments', which has the same type ('DeclNameArgumentsSyntax')" ), + // MARK: Alternate names for InitializerClauseSyntax + // The cases below don’t have intializers but just a syntactic element that happens to be spelled the same ValidationFailure( - node: .macroExpansionExpr, + node: .enumCaseElement, message: - "child 'GenericArguments' is named inconsistently with 'KeyPathPropertyComponentSyntax.GenericArgumentClause', which has the same type ('GenericArgumentClauseSyntax')" + "child 'RawValue' is named inconsistently with 'MatchingPatternConditionSyntax.Initializer', which has the same type ('InitializerClauseSyntax')" ), ValidationFailure( node: .enumCaseParameter, - message: "child 'DefaultArgument' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')" + message: + "child 'DefaultArgument' is named inconsistently with 'MatchingPatternConditionSyntax.Initializer', which has the same type ('InitializerClauseSyntax')" ), ValidationFailure( node: .functionParameter, - message: "child 'DefaultArgument' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')" + message: + "child 'DefaultArgument' is named inconsistently with 'MatchingPatternConditionSyntax.Initializer', which has the same type ('InitializerClauseSyntax')" ), ValidationFailure( node: .macroDecl, - message: "child 'Definition' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')" - ), - ValidationFailure( - node: .matchingPatternCondition, - message: "child 'Initializer' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')" - ), - ValidationFailure( - node: .optionalBindingCondition, - message: "child 'Initializer' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')" - ), - ValidationFailure( - node: .patternBinding, - message: "child 'Initializer' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')" - ), - ValidationFailure( - node: .tupleTypeElement, - message: "child 'Initializer' is named inconsistently with 'EnumCaseElementSyntax.RawValue', which has the same type ('InitializerClauseSyntax')" + message: + "child 'Definition' is named inconsistently with 'MatchingPatternConditionSyntax.Initializer', which has the same type ('InitializerClauseSyntax')" ), + // MARK: Miscellaneous ValidationFailure( node: .multipleTrailingClosureElement, message: "child 'Closure' is named inconsistently with 'FunctionCallExprSyntax.TrailingClosure', which has the same type ('ClosureExprSyntax')" ), - ValidationFailure( - node: .subscriptDecl, - message: "child 'Result' is named inconsistently with 'ClosureSignatureSyntax.Output', which has the same type ('ReturnClauseSyntax')" - ), - ValidationFailure( - node: .canImportVersionInfo, - message: - "child 'VersionTuple' is named inconsistently with 'AvailabilityVersionRestrictionSyntax.Version', which has the same type ('VersionTupleSyntax')" - ), - ValidationFailure( - node: .exposeAttributeArguments, - message: - "child 'CxxName' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')" - ), - ValidationFailure( - node: .opaqueReturnTypeOfAttributeArguments, - message: - "child 'MangledName' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')" - ), - ValidationFailure( - node: .originallyDefinedInArguments, - message: - "child 'ModuleName' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')" - ), - ValidationFailure( - node: .poundSourceLocationArgs, - message: - "child 'FileName' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')" - ), - ValidationFailure( - node: .unavailableFromAsyncArguments, - message: - "child 'Message' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')" - ), - ValidationFailure( - node: .underscorePrivateAttributeArguments, - message: - "child 'Filename' is named inconsistently with 'ConventionAttributeArgumentsSyntax.CTypeString', which has the same type ('StringLiteralExprSyntax')" - ), ] ) } diff --git a/Sources/SwiftParser/Attributes.swift b/Sources/SwiftParser/Attributes.swift index 4b9567b2653..8f95a9b24a8 100644 --- a/Sources/SwiftParser/Attributes.swift +++ b/Sources/SwiftParser/Attributes.swift @@ -423,7 +423,7 @@ extension Parser { kindSpecifierComma: kindSpecifierComma, parameters: parameters, parametersComma: parametersComma, - whereClause: whereClause, + genericWhereClause: whereClause, arena: self.arena ) } @@ -683,8 +683,8 @@ extension Parser { let (unexpectedBeforeColon, colon) = self.expect(.colon) let (targetFunction, args) = self.parseDeclNameRef([.zeroArgCompoundNames, .keywordsUsingSpecialNames, .operators]) let declName = RawDeclNameSyntax( - declBaseName: targetFunction, - declNameArguments: args, + baseName: targetFunction, + arguments: args, arena: self.arena ) let comma = self.consume(if: .comma) @@ -1031,7 +1031,7 @@ extension Parser { .zeroArgCompoundNames, .keywordsUsingSpecialNames, .operators, ]) } - let method = RawDeclNameSyntax(declBaseName: base, declNameArguments: args, arena: self.arena) + let method = RawDeclNameSyntax(baseName: base, arguments: args, arena: self.arena) return RawDynamicReplacementArgumentsSyntax( unexpectedBeforeLabel, forLabel: label, diff --git a/Sources/SwiftParser/Declarations.swift b/Sources/SwiftParser/Declarations.swift index 42e2799d9c4..32258088ac9 100644 --- a/Sources/SwiftParser/Declarations.swift +++ b/Sources/SwiftParser/Declarations.swift @@ -1168,35 +1168,35 @@ extension Parser { } mutating func parseFunctionSignature(allowOutput: Bool = true) -> RawFunctionSignatureSyntax { - let input = self.parseParameterClause(RawParameterClauseSyntax.self) { parser in + let parameterClause = self.parseParameterClause(RawParameterClauseSyntax.self) { parser in parser.parseFunctionParameter() } var effectSpecifiers = self.parseFunctionEffectSpecifiers() - var output: RawReturnClauseSyntax? + var returnClause: RawReturnClauseSyntax? /// Only allow recovery to the arrow with exprKeyword precedence so we only /// skip over misplaced identifiers and don't e.g. recover to an arrow in a 'where' clause. if self.canRecoverTo(TokenSpec(.arrow, recoveryPrecedence: .exprKeyword)) != nil { - output = self.parseFunctionReturnClause(effectSpecifiers: &effectSpecifiers, allowNamedOpaqueResultType: true) + returnClause = self.parseFunctionReturnClause(effectSpecifiers: &effectSpecifiers, allowNamedOpaqueResultType: true) } else { - output = nil + returnClause = nil } - var unexpectedAfterOutput: RawUnexpectedNodesSyntax? + var unexpectedAfterReturnClause: RawUnexpectedNodesSyntax? if !allowOutput, - let unexpectedOutput = output + let unexpectedOutput = returnClause { - output = nil - unexpectedAfterOutput = RawUnexpectedNodesSyntax([unexpectedOutput], arena: self.arena) + returnClause = nil + unexpectedAfterReturnClause = RawUnexpectedNodesSyntax([unexpectedOutput], arena: self.arena) } return RawFunctionSignatureSyntax( - input: input, + parameterClause: parameterClause, effectSpecifiers: effectSpecifiers, - output: output, - unexpectedAfterOutput, + returnClause: returnClause, + unexpectedAfterReturnClause, arena: self.arena ) } @@ -1233,12 +1233,12 @@ extension Parser { genericParameterClause = nil } - let indices = self.parseParameterClause(RawParameterClauseSyntax.self) { parser in + let parameterClause = self.parseParameterClause(RawParameterClauseSyntax.self) { parser in parser.parseFunctionParameter() } var misplacedEffectSpecifiers: RawFunctionEffectSpecifiersSyntax? - let result = self.parseFunctionReturnClause(effectSpecifiers: &misplacedEffectSpecifiers, allowNamedOpaqueResultType: true) + let returnClause = self.parseFunctionReturnClause(effectSpecifiers: &misplacedEffectSpecifiers, allowNamedOpaqueResultType: true) // Parse a 'where' clause if present. let genericWhereClause: RawGenericWhereClauseSyntax? @@ -1263,8 +1263,8 @@ extension Parser { subscriptKeyword: subscriptKeyword, RawUnexpectedNodesSyntax([unexpectedName], arena: self.arena), genericParameterClause: genericParameterClause, - indices: indices, - result: result, + parameterClause: parameterClause, + returnClause: returnClause, genericWhereClause: genericWhereClause, accessor: accessor, arena: self.arena @@ -2121,7 +2121,7 @@ extension Parser { pound: pound, unexpectedBeforeMacro, macro: macro, - genericArguments: generics, + genericArgumentClause: generics, leftParen: leftParen, argumentList: RawTupleExprElementListSyntax( elements: args, diff --git a/Sources/SwiftParser/Expressions.swift b/Sources/SwiftParser/Expressions.swift index 592a5865239..7c7dea9fc72 100644 --- a/Sources/SwiftParser/Expressions.swift +++ b/Sources/SwiftParser/Expressions.swift @@ -1468,7 +1468,7 @@ extension Parser { pound: pound, unexpectedBeforeMacro, macro: macro, - genericArguments: generics, + genericArgumentClause: generics, leftParen: leftParen, argumentList: RawTupleExprElementListSyntax( elements: args, @@ -1941,16 +1941,16 @@ extension Parser { captures = nil } - var input: RawClosureSignatureSyntax.Input? + var parameterClause: RawClosureSignatureSyntax.ParameterClause? var effectSpecifiers: RawTypeEffectSpecifiersSyntax? - var output: RawReturnClauseSyntax? = nil + var returnClause: RawReturnClauseSyntax? = nil if !self.at(.keyword(.in)) { if self.at(.leftParen) { // Parse the closure arguments. let params = self.parseParameterClause(RawClosureParameterClauseSyntax.self) { parser in parser.parseClosureParameter() } - input = .input(params) + parameterClause = .parameterClause(params) } else { var params = [RawClosureParamSyntax]() var loopProgress = LoopProgressCondition() @@ -1978,13 +1978,13 @@ extension Parser { } while keepGoing != nil && loopProgress.evaluate(currentToken) } - input = .simpleInput(RawClosureParamListSyntax(elements: params, arena: self.arena)) + parameterClause = .simpleInput(RawClosureParamListSyntax(elements: params, arena: self.arena)) } effectSpecifiers = self.parseTypeEffectSpecifiers() if self.at(.arrow) { - output = self.parseFunctionReturnClause(effectSpecifiers: &effectSpecifiers, allowNamedOpaqueResultType: false) + returnClause = self.parseFunctionReturnClause(effectSpecifiers: &effectSpecifiers, allowNamedOpaqueResultType: false) } } @@ -1993,9 +1993,9 @@ extension Parser { return RawClosureSignatureSyntax( attributes: attrs, capture: captures, - input: input, + parameterClause: parameterClause, effectSpecifiers: effectSpecifiers, - output: output, + returnClause: returnClause, unexpectedBeforeInKeyword, inKeyword: inKeyword, arena: self.arena @@ -2631,7 +2631,7 @@ extension Parser { label: label, unexpectedBeforeColon, colon: colon, - versionTuple: version, + version: version, arena: self.arena ) } diff --git a/Sources/SwiftParser/Types.swift b/Sources/SwiftParser/Types.swift index 39408335b8a..fde11d3a569 100644 --- a/Sources/SwiftParser/Types.swift +++ b/Sources/SwiftParser/Types.swift @@ -104,7 +104,7 @@ extension Parser { unexpectedBetweenElementsAndRightParen, rightParen: rightParen, effectSpecifiers: effectSpecifiers, - output: returnClause, + returnClause: returnClause, arena: self.arena ) ) diff --git a/Sources/SwiftParser/generated/Parser+TokenSpecSet.swift b/Sources/SwiftParser/generated/Parser+TokenSpecSet.swift index 183add89c19..fa585620804 100644 --- a/Sources/SwiftParser/generated/Parser+TokenSpecSet.swift +++ b/Sources/SwiftParser/generated/Parser+TokenSpecSet.swift @@ -653,7 +653,7 @@ extension DeclModifierSyntax { } extension DeclNameSyntax { - enum DeclBaseNameOptions: TokenSpecSet { + enum BaseNameOptions: TokenSpecSet { case identifier case binaryOperator case `init` diff --git a/Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift b/Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift index e41df780f42..d33a7c9010c 100644 --- a/Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift +++ b/Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift @@ -640,7 +640,7 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor { return .skipChildren } - if let versionTuple = node.versionInfo?.versionTuple, + if let versionTuple = node.versionInfo?.version, let unexpectedVersionTuple = node.unexpectedBetweenVersionInfoAndRightParen { if versionTuple.major.isMissing { @@ -673,7 +673,7 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor { handledNodes: [node.label.id] ) - handledNodes.append(contentsOf: [node.unexpectedBetweenLabelAndColon?.id, node.colon.id, node.versionTuple.id].compactMap { $0 }) + handledNodes.append(contentsOf: [node.unexpectedBetweenLabelAndColon?.id, node.colon.id, node.version.id].compactMap { $0 }) } return .visitChildren @@ -711,7 +711,7 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor { if shouldSkip(node) { return .skipChildren } - handleMisplacedEffectSpecifiers(effectSpecifiers: node.effectSpecifiers, output: node.output) + handleMisplacedEffectSpecifiers(effectSpecifiers: node.effectSpecifiers, output: node.returnClause) return .visitChildren } @@ -1005,7 +1005,7 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor { if shouldSkip(node) { return .skipChildren } - handleMisplacedEffectSpecifiers(effectSpecifiers: node.effectSpecifiers, output: node.output) + handleMisplacedEffectSpecifiers(effectSpecifiers: node.effectSpecifiers, output: node.returnClause) return .visitChildren } @@ -1013,7 +1013,7 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor { if shouldSkip(node) { return .skipChildren } - handleMisplacedEffectSpecifiers(effectSpecifiers: node.effectSpecifiers, output: node.output) + handleMisplacedEffectSpecifiers(effectSpecifiers: node.effectSpecifiers, output: node.returnClause) return .visitChildren } @@ -1196,7 +1196,7 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor { return .skipChildren } - if let unexpectedName = node.signature.input.unexpectedBeforeLeftParen, + if let unexpectedName = node.signature.parameterClause.unexpectedBeforeLeftParen, let previous = unexpectedName.previousToken(viewMode: .sourceAccurate) { addDiagnostic( @@ -1215,7 +1215,7 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor { ) } - if let unexpectedOutput = node.signature.unexpectedAfterOutput { + if let unexpectedOutput = node.signature.unexpectedAfterReturnClause { addDiagnostic( unexpectedOutput, .initializerCannotHaveResultType, @@ -1580,7 +1580,7 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor { handledNodes: [unexpected.id] ) } - if let unexpected = node.indices.unexpectedBeforeLeftParen, + if let unexpected = node.parameterClause.unexpectedBeforeLeftParen, let nameTokens = unexpected.onlyPresentTokens(satisfying: { !$0.tokenKind.isLexerClassifiedKeyword }) { addDiagnostic( diff --git a/Sources/SwiftParserDiagnostics/generated/ChildNameForDiagnostics.swift b/Sources/SwiftParserDiagnostics/generated/ChildNameForDiagnostics.swift index f1ceec2b6fc..aca39cd725b 100644 --- a/Sources/SwiftParserDiagnostics/generated/ChildNameForDiagnostics.swift +++ b/Sources/SwiftParserDiagnostics/generated/ChildNameForDiagnostics.swift @@ -86,9 +86,9 @@ private func childNameForDiagnostics(_ keyPath: AnyKeyPath) -> String? { return "statements" case \ContinueStmtSyntax.label: return "label" - case \DeclNameSyntax.declBaseName: + case \DeclNameSyntax.baseName: return "base name" - case \DeclNameSyntax.declNameArguments: + case \DeclNameSyntax.arguments: return "arguments" case \DeinitializerDeclSyntax.attributes: return "attributes" diff --git a/Sources/SwiftRefactor/ExpandEditorPlaceholder.swift b/Sources/SwiftRefactor/ExpandEditorPlaceholder.swift index 4382c68247e..38e9ff73622 100644 --- a/Sources/SwiftRefactor/ExpandEditorPlaceholder.swift +++ b/Sources/SwiftRefactor/ExpandEditorPlaceholder.swift @@ -175,14 +175,14 @@ extension FunctionTypeSyntax { ClosureParamSyntax(name: arg.expansionNameToken()) } } - closureSignature = ClosureSignatureSyntax(input: .simpleInput(args)) + closureSignature = ClosureSignatureSyntax(parameterClause: .simpleInput(args)) } else { closureSignature = nil } // Single statement for the body - the placeholder-ed type if non-void and // 'code' otherwise. - let ret = output.returnType.description + let ret = returnClause.returnType.description let placeholder: String if ret == "Void" || ret == "()" { placeholder = ExpandEditorPlaceholder.wrapInTypePlaceholder("code", type: "Void") diff --git a/Sources/SwiftRefactor/OpaqueParameterToGeneric.swift b/Sources/SwiftRefactor/OpaqueParameterToGeneric.swift index 90351a73231..c14128e30b0 100644 --- a/Sources/SwiftRefactor/OpaqueParameterToGeneric.swift +++ b/Sources/SwiftRefactor/OpaqueParameterToGeneric.swift @@ -180,7 +180,7 @@ public struct OpaqueParameterToGeneric: SyntaxRefactoringProvider { if let funcSyntax = decl.as(FunctionDeclSyntax.self) { guard let (newInput, newGenericParams) = replaceSomeParameters( - in: funcSyntax.signature.input, + in: funcSyntax.signature.parameterClause, augmenting: funcSyntax.genericParameterClause ) else { @@ -189,7 +189,7 @@ public struct OpaqueParameterToGeneric: SyntaxRefactoringProvider { return DeclSyntax( funcSyntax - .with(\.signature, funcSyntax.signature.with(\.input, newInput)) + .with(\.signature, funcSyntax.signature.with(\.parameterClause, newInput)) .with(\.genericParameterClause, newGenericParams) ) } @@ -198,7 +198,7 @@ public struct OpaqueParameterToGeneric: SyntaxRefactoringProvider { if let initSyntax = decl.as(InitializerDeclSyntax.self) { guard let (newInput, newGenericParams) = replaceSomeParameters( - in: initSyntax.signature.input, + in: initSyntax.signature.parameterClause, augmenting: initSyntax.genericParameterClause ) else { @@ -207,7 +207,7 @@ public struct OpaqueParameterToGeneric: SyntaxRefactoringProvider { return DeclSyntax( initSyntax - .with(\.signature, initSyntax.signature.with(\.input, newInput)) + .with(\.signature, initSyntax.signature.with(\.parameterClause, newInput)) .with(\.genericParameterClause, newGenericParams) ) } @@ -216,7 +216,7 @@ public struct OpaqueParameterToGeneric: SyntaxRefactoringProvider { if let subscriptSyntax = decl.as(SubscriptDeclSyntax.self) { guard let (newIndices, newGenericParams) = replaceSomeParameters( - in: subscriptSyntax.indices, + in: subscriptSyntax.parameterClause, augmenting: subscriptSyntax.genericParameterClause ) else { @@ -225,7 +225,7 @@ public struct OpaqueParameterToGeneric: SyntaxRefactoringProvider { return DeclSyntax( subscriptSyntax - .with(\.indices, newIndices) + .with(\.parameterClause, newIndices) .with(\.genericParameterClause, newGenericParams) ) } diff --git a/Sources/SwiftSyntax/SwiftSyntaxCompatibility.swift b/Sources/SwiftSyntax/SwiftSyntaxCompatibility.swift index dfff0e2e321..6385a3458f5 100644 --- a/Sources/SwiftSyntax/SwiftSyntaxCompatibility.swift +++ b/Sources/SwiftSyntax/SwiftSyntaxCompatibility.swift @@ -22,6 +22,18 @@ public typealias AccessPathComponentSyntax = ImportPathComponentSyntax @available(*, deprecated, renamed: "WithAttributesSyntax") public typealias AttributedSyntax = WithAttributesSyntax +extension ClosureSignatureSyntax { + @available(*, deprecated, renamed: "ParameterClause") + public typealias Input = ParameterClause +} + +extension ClosureSignatureSyntax.ParameterClause { + @available(*, deprecated, renamed: "parameterClause") + public static func input(_ parameterClause: ClosureParameterClauseSyntax) -> Self { + return .parameterClause(parameterClause) + } +} + public extension DeclGroupSyntax { @available(*, deprecated, renamed: "memberBlock") var members: MemberDeclBlockSyntax { @@ -34,6 +46,18 @@ public extension DeclGroupSyntax { } } +public extension FreestandingMacroExpansionSyntax { + @available(*, deprecated, renamed: "genericArgumentClause") + var genericArguments: GenericArgumentClauseSyntax? { + get { + return genericArgumentClause + } + set { + genericArgumentClause = newValue + } + } +} + public extension SyntaxProtocol { @available(*, deprecated, message: "Use detached computed property instead.") func detach() -> Self { diff --git a/Sources/SwiftSyntax/generated/ChildNameForKeyPath.swift b/Sources/SwiftSyntax/generated/ChildNameForKeyPath.swift index 6c42942940e..8a7a3351c8e 100644 --- a/Sources/SwiftSyntax/generated/ChildNameForKeyPath.swift +++ b/Sources/SwiftSyntax/generated/ChildNameForKeyPath.swift @@ -455,12 +455,12 @@ public func childName(_ keyPath: AnyKeyPath) -> String? { return "unexpectedBetweenLabelAndColon" case \CanImportVersionInfoSyntax.colon: return "colon" - case \CanImportVersionInfoSyntax.unexpectedBetweenColonAndVersionTuple: - return "unexpectedBetweenColonAndVersionTuple" - case \CanImportVersionInfoSyntax.versionTuple: - return "versionTuple" - case \CanImportVersionInfoSyntax.unexpectedAfterVersionTuple: - return "unexpectedAfterVersionTuple" + case \CanImportVersionInfoSyntax.unexpectedBetweenColonAndVersion: + return "unexpectedBetweenColonAndVersion" + case \CanImportVersionInfoSyntax.version: + return "version" + case \CanImportVersionInfoSyntax.unexpectedAfterVersion: + return "unexpectedAfterVersion" case \CaseItemSyntax.unexpectedBeforePattern: return "unexpectedBeforePattern" case \CaseItemSyntax.pattern: @@ -681,20 +681,20 @@ public func childName(_ keyPath: AnyKeyPath) -> String? { return "unexpectedBetweenAttributesAndCapture" case \ClosureSignatureSyntax.capture: return "capture" - case \ClosureSignatureSyntax.unexpectedBetweenCaptureAndInput: - return "unexpectedBetweenCaptureAndInput" - case \ClosureSignatureSyntax.input: - return "input" - case \ClosureSignatureSyntax.unexpectedBetweenInputAndEffectSpecifiers: - return "unexpectedBetweenInputAndEffectSpecifiers" + case \ClosureSignatureSyntax.unexpectedBetweenCaptureAndParameterClause: + return "unexpectedBetweenCaptureAndParameterClause" + case \ClosureSignatureSyntax.parameterClause: + return "parameterClause" + case \ClosureSignatureSyntax.unexpectedBetweenParameterClauseAndEffectSpecifiers: + return "unexpectedBetweenParameterClauseAndEffectSpecifiers" case \ClosureSignatureSyntax.effectSpecifiers: return "effectSpecifiers" - case \ClosureSignatureSyntax.unexpectedBetweenEffectSpecifiersAndOutput: - return "unexpectedBetweenEffectSpecifiersAndOutput" - case \ClosureSignatureSyntax.output: - return "output" - case \ClosureSignatureSyntax.unexpectedBetweenOutputAndInKeyword: - return "unexpectedBetweenOutputAndInKeyword" + case \ClosureSignatureSyntax.unexpectedBetweenEffectSpecifiersAndReturnClause: + return "unexpectedBetweenEffectSpecifiersAndReturnClause" + case \ClosureSignatureSyntax.returnClause: + return "returnClause" + case \ClosureSignatureSyntax.unexpectedBetweenReturnClauseAndInKeyword: + return "unexpectedBetweenReturnClauseAndInKeyword" case \ClosureSignatureSyntax.inKeyword: return "inKeyword" case \ClosureSignatureSyntax.unexpectedAfterInKeyword: @@ -877,16 +877,16 @@ public func childName(_ keyPath: AnyKeyPath) -> String? { return "rightParen" case \DeclNameArgumentsSyntax.unexpectedAfterRightParen: return "unexpectedAfterRightParen" - case \DeclNameSyntax.unexpectedBeforeDeclBaseName: - return "unexpectedBeforeDeclBaseName" - case \DeclNameSyntax.declBaseName: - return "declBaseName" - case \DeclNameSyntax.unexpectedBetweenDeclBaseNameAndDeclNameArguments: - return "unexpectedBetweenDeclBaseNameAndDeclNameArguments" - case \DeclNameSyntax.declNameArguments: - return "declNameArguments" - case \DeclNameSyntax.unexpectedAfterDeclNameArguments: - return "unexpectedAfterDeclNameArguments" + case \DeclNameSyntax.unexpectedBeforeBaseName: + return "unexpectedBeforeBaseName" + case \DeclNameSyntax.baseName: + return "baseName" + case \DeclNameSyntax.unexpectedBetweenBaseNameAndArguments: + return "unexpectedBetweenBaseNameAndArguments" + case \DeclNameSyntax.arguments: + return "arguments" + case \DeclNameSyntax.unexpectedAfterArguments: + return "unexpectedAfterArguments" case \DeferStmtSyntax.unexpectedBeforeDeferKeyword: return "unexpectedBeforeDeferKeyword" case \DeferStmtSyntax.deferKeyword: @@ -1073,12 +1073,12 @@ public func childName(_ keyPath: AnyKeyPath) -> String? { return "unexpectedBetweenParametersAndParametersComma" case \DifferentiableAttributeArgumentsSyntax.parametersComma: return "parametersComma" - case \DifferentiableAttributeArgumentsSyntax.unexpectedBetweenParametersCommaAndWhereClause: - return "unexpectedBetweenParametersCommaAndWhereClause" - case \DifferentiableAttributeArgumentsSyntax.whereClause: - return "whereClause" - case \DifferentiableAttributeArgumentsSyntax.unexpectedAfterWhereClause: - return "unexpectedAfterWhereClause" + case \DifferentiableAttributeArgumentsSyntax.unexpectedBetweenParametersCommaAndGenericWhereClause: + return "unexpectedBetweenParametersCommaAndGenericWhereClause" + case \DifferentiableAttributeArgumentsSyntax.genericWhereClause: + return "genericWhereClause" + case \DifferentiableAttributeArgumentsSyntax.unexpectedAfterGenericWhereClause: + return "unexpectedAfterGenericWhereClause" case \DiscardAssignmentExprSyntax.unexpectedBeforeWildcard: return "unexpectedBeforeWildcard" case \DiscardAssignmentExprSyntax.wildcard: @@ -1525,20 +1525,20 @@ public func childName(_ keyPath: AnyKeyPath) -> String? { return "trailingComma" case \FunctionParameterSyntax.unexpectedAfterTrailingComma: return "unexpectedAfterTrailingComma" - case \FunctionSignatureSyntax.unexpectedBeforeInput: - return "unexpectedBeforeInput" - case \FunctionSignatureSyntax.input: - return "input" - case \FunctionSignatureSyntax.unexpectedBetweenInputAndEffectSpecifiers: - return "unexpectedBetweenInputAndEffectSpecifiers" + case \FunctionSignatureSyntax.unexpectedBeforeParameterClause: + return "unexpectedBeforeParameterClause" + case \FunctionSignatureSyntax.parameterClause: + return "parameterClause" + case \FunctionSignatureSyntax.unexpectedBetweenParameterClauseAndEffectSpecifiers: + return "unexpectedBetweenParameterClauseAndEffectSpecifiers" case \FunctionSignatureSyntax.effectSpecifiers: return "effectSpecifiers" - case \FunctionSignatureSyntax.unexpectedBetweenEffectSpecifiersAndOutput: - return "unexpectedBetweenEffectSpecifiersAndOutput" - case \FunctionSignatureSyntax.output: - return "output" - case \FunctionSignatureSyntax.unexpectedAfterOutput: - return "unexpectedAfterOutput" + case \FunctionSignatureSyntax.unexpectedBetweenEffectSpecifiersAndReturnClause: + return "unexpectedBetweenEffectSpecifiersAndReturnClause" + case \FunctionSignatureSyntax.returnClause: + return "returnClause" + case \FunctionSignatureSyntax.unexpectedAfterReturnClause: + return "unexpectedAfterReturnClause" case \FunctionTypeSyntax.unexpectedBeforeLeftParen: return "unexpectedBeforeLeftParen" case \FunctionTypeSyntax.leftParen: @@ -1555,12 +1555,12 @@ public func childName(_ keyPath: AnyKeyPath) -> String? { return "unexpectedBetweenRightParenAndEffectSpecifiers" case \FunctionTypeSyntax.effectSpecifiers: return "effectSpecifiers" - case \FunctionTypeSyntax.unexpectedBetweenEffectSpecifiersAndOutput: - return "unexpectedBetweenEffectSpecifiersAndOutput" - case \FunctionTypeSyntax.output: - return "output" - case \FunctionTypeSyntax.unexpectedAfterOutput: - return "unexpectedAfterOutput" + case \FunctionTypeSyntax.unexpectedBetweenEffectSpecifiersAndReturnClause: + return "unexpectedBetweenEffectSpecifiersAndReturnClause" + case \FunctionTypeSyntax.returnClause: + return "returnClause" + case \FunctionTypeSyntax.unexpectedAfterReturnClause: + return "unexpectedAfterReturnClause" case \GenericArgumentClauseSyntax.unexpectedBeforeLeftAngle: return "unexpectedBeforeLeftAngle" case \GenericArgumentClauseSyntax.leftAngle: @@ -2089,12 +2089,12 @@ public func childName(_ keyPath: AnyKeyPath) -> String? { return "unexpectedBetweenPoundAndMacro" case \MacroExpansionDeclSyntax.macro: return "macro" - case \MacroExpansionDeclSyntax.unexpectedBetweenMacroAndGenericArguments: - return "unexpectedBetweenMacroAndGenericArguments" - case \MacroExpansionDeclSyntax.genericArguments: - return "genericArguments" - case \MacroExpansionDeclSyntax.unexpectedBetweenGenericArgumentsAndLeftParen: - return "unexpectedBetweenGenericArgumentsAndLeftParen" + case \MacroExpansionDeclSyntax.unexpectedBetweenMacroAndGenericArgumentClause: + return "unexpectedBetweenMacroAndGenericArgumentClause" + case \MacroExpansionDeclSyntax.genericArgumentClause: + return "genericArgumentClause" + case \MacroExpansionDeclSyntax.unexpectedBetweenGenericArgumentClauseAndLeftParen: + return "unexpectedBetweenGenericArgumentClauseAndLeftParen" case \MacroExpansionDeclSyntax.leftParen: return "leftParen" case \MacroExpansionDeclSyntax.unexpectedBetweenLeftParenAndArgumentList: @@ -2123,12 +2123,12 @@ public func childName(_ keyPath: AnyKeyPath) -> String? { return "unexpectedBetweenPoundAndMacro" case \MacroExpansionExprSyntax.macro: return "macro" - case \MacroExpansionExprSyntax.unexpectedBetweenMacroAndGenericArguments: - return "unexpectedBetweenMacroAndGenericArguments" - case \MacroExpansionExprSyntax.genericArguments: - return "genericArguments" - case \MacroExpansionExprSyntax.unexpectedBetweenGenericArgumentsAndLeftParen: - return "unexpectedBetweenGenericArgumentsAndLeftParen" + case \MacroExpansionExprSyntax.unexpectedBetweenMacroAndGenericArgumentClause: + return "unexpectedBetweenMacroAndGenericArgumentClause" + case \MacroExpansionExprSyntax.genericArgumentClause: + return "genericArgumentClause" + case \MacroExpansionExprSyntax.unexpectedBetweenGenericArgumentClauseAndLeftParen: + return "unexpectedBetweenGenericArgumentClauseAndLeftParen" case \MacroExpansionExprSyntax.leftParen: return "leftParen" case \MacroExpansionExprSyntax.unexpectedBetweenLeftParenAndArgumentList: @@ -2941,16 +2941,16 @@ public func childName(_ keyPath: AnyKeyPath) -> String? { return "unexpectedBetweenSubscriptKeywordAndGenericParameterClause" case \SubscriptDeclSyntax.genericParameterClause: return "genericParameterClause" - case \SubscriptDeclSyntax.unexpectedBetweenGenericParameterClauseAndIndices: - return "unexpectedBetweenGenericParameterClauseAndIndices" - case \SubscriptDeclSyntax.indices: - return "indices" - case \SubscriptDeclSyntax.unexpectedBetweenIndicesAndResult: - return "unexpectedBetweenIndicesAndResult" - case \SubscriptDeclSyntax.result: - return "result" - case \SubscriptDeclSyntax.unexpectedBetweenResultAndGenericWhereClause: - return "unexpectedBetweenResultAndGenericWhereClause" + case \SubscriptDeclSyntax.unexpectedBetweenGenericParameterClauseAndParameterClause: + return "unexpectedBetweenGenericParameterClauseAndParameterClause" + case \SubscriptDeclSyntax.parameterClause: + return "parameterClause" + case \SubscriptDeclSyntax.unexpectedBetweenParameterClauseAndReturnClause: + return "unexpectedBetweenParameterClauseAndReturnClause" + case \SubscriptDeclSyntax.returnClause: + return "returnClause" + case \SubscriptDeclSyntax.unexpectedBetweenReturnClauseAndGenericWhereClause: + return "unexpectedBetweenReturnClauseAndGenericWhereClause" case \SubscriptDeclSyntax.genericWhereClause: return "genericWhereClause" case \SubscriptDeclSyntax.unexpectedBetweenGenericWhereClauseAndAccessor: diff --git a/Sources/SwiftSyntax/generated/RenamedChildrenCompatibility.swift b/Sources/SwiftSyntax/generated/RenamedChildrenCompatibility.swift index 2e80399270c..a122fad0d03 100644 --- a/Sources/SwiftSyntax/generated/RenamedChildrenCompatibility.swift +++ b/Sources/SwiftSyntax/generated/RenamedChildrenCompatibility.swift @@ -828,6 +828,69 @@ extension BooleanLiteralExprSyntax { } } +extension CanImportVersionInfoSyntax { + @available(*, deprecated, renamed: "unexpectedBetweenColonAndVersion") + public var unexpectedBetweenColonAndVersionTuple: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenColonAndVersion + } + set { + unexpectedBetweenColonAndVersion = newValue + } + } + + @available(*, deprecated, renamed: "version") + public var versionTuple: VersionTupleSyntax { + get { + return version + } + set { + version = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedAfterVersion") + public var unexpectedAfterVersionTuple: UnexpectedNodesSyntax? { + get { + return unexpectedAfterVersion + } + set { + unexpectedAfterVersion = newValue + } + } + + @available(*, deprecated, message: "Use an initializer with version argument(s).") + @_disfavoredOverload + public init( + leadingTrivia: Trivia? = nil, + _ unexpectedBeforeComma: UnexpectedNodesSyntax? = nil, + comma: TokenSyntax = .commaToken(), + _ unexpectedBetweenCommaAndLabel: UnexpectedNodesSyntax? = nil, + label: TokenSyntax, + _ unexpectedBetweenLabelAndColon: UnexpectedNodesSyntax? = nil, + colon: TokenSyntax = .colonToken(), + _ unexpectedBetweenColonAndVersionTuple: UnexpectedNodesSyntax? = nil, + versionTuple: VersionTupleSyntax, + _ unexpectedAfterVersionTuple: UnexpectedNodesSyntax? = nil, + trailingTrivia: Trivia? = nil + + ) { + self.init( + leadingTrivia: leadingTrivia, + unexpectedBeforeComma, + comma: comma, + unexpectedBetweenCommaAndLabel, + label: label, + unexpectedBetweenLabelAndColon, + colon: colon, + unexpectedBetweenColonAndVersionTuple, + version: versionTuple, + unexpectedAfterVersionTuple, + trailingTrivia: trailingTrivia + ) + } +} + extension ClosureCaptureItemSyntax { @available(*, deprecated, renamed: "unexpectedBetweenNameAndEqual") public var unexpectedBetweenNameAndAssignToken: UnexpectedNodesSyntax? { @@ -896,13 +959,63 @@ extension ClosureCaptureItemSyntax { } extension ClosureSignatureSyntax { - @available(*, deprecated, renamed: "unexpectedBetweenOutputAndInKeyword") + @available(*, deprecated, renamed: "unexpectedBetweenCaptureAndParameterClause") + public var unexpectedBetweenCaptureAndInput: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenCaptureAndParameterClause + } + set { + unexpectedBetweenCaptureAndParameterClause = newValue + } + } + + @available(*, deprecated, renamed: "parameterClause") + public var input: ParameterClause? { + get { + return parameterClause + } + set { + parameterClause = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenParameterClauseAndEffectSpecifiers") + public var unexpectedBetweenInputAndEffectSpecifiers: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenParameterClauseAndEffectSpecifiers + } + set { + unexpectedBetweenParameterClauseAndEffectSpecifiers = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenEffectSpecifiersAndReturnClause") + public var unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenEffectSpecifiersAndReturnClause + } + set { + unexpectedBetweenEffectSpecifiersAndReturnClause = newValue + } + } + + @available(*, deprecated, renamed: "returnClause") + public var output: ReturnClauseSyntax? { + get { + return returnClause + } + set { + returnClause = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenReturnClauseAndInKeyword") public var unexpectedBetweenOutputAndInTok: UnexpectedNodesSyntax? { get { - return unexpectedBetweenOutputAndInKeyword + return unexpectedBetweenReturnClauseAndInKeyword } set { - unexpectedBetweenOutputAndInKeyword = newValue + unexpectedBetweenReturnClauseAndInKeyword = newValue } } @@ -926,7 +1039,7 @@ extension ClosureSignatureSyntax { } } - @available(*, deprecated, message: "Use an initializer with inKeyword argument(s).") + @available(*, deprecated, message: "Use an initializer with parameterClause, returnClause, inKeyword argument(s).") @_disfavoredOverload public init( leadingTrivia: Trivia? = nil, @@ -935,7 +1048,7 @@ extension ClosureSignatureSyntax { _ unexpectedBetweenAttributesAndCapture: UnexpectedNodesSyntax? = nil, capture: ClosureCaptureSignatureSyntax? = nil, _ unexpectedBetweenCaptureAndInput: UnexpectedNodesSyntax? = nil, - input: Input? = nil, + input: ParameterClause? = nil, _ unexpectedBetweenInputAndEffectSpecifiers: UnexpectedNodesSyntax? = nil, effectSpecifiers: TypeEffectSpecifiersSyntax? = nil, _ unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? = nil, @@ -953,11 +1066,11 @@ extension ClosureSignatureSyntax { unexpectedBetweenAttributesAndCapture, capture: capture, unexpectedBetweenCaptureAndInput, - input: input, + parameterClause: input, unexpectedBetweenInputAndEffectSpecifiers, effectSpecifiers: effectSpecifiers, unexpectedBetweenEffectSpecifiersAndOutput, - output: output, + returnClause: output, unexpectedBetweenOutputAndInTok, inKeyword: inTok, unexpectedAfterInTok, @@ -966,6 +1079,81 @@ extension ClosureSignatureSyntax { } } +extension DeclNameSyntax { + @available(*, deprecated, renamed: "unexpectedBeforeBaseName") + public var unexpectedBeforeDeclBaseName: UnexpectedNodesSyntax? { + get { + return unexpectedBeforeBaseName + } + set { + unexpectedBeforeBaseName = newValue + } + } + + @available(*, deprecated, renamed: "baseName") + public var declBaseName: TokenSyntax { + get { + return baseName + } + set { + baseName = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenBaseNameAndArguments") + public var unexpectedBetweenDeclBaseNameAndDeclNameArguments: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenBaseNameAndArguments + } + set { + unexpectedBetweenBaseNameAndArguments = newValue + } + } + + @available(*, deprecated, renamed: "arguments") + public var declNameArguments: DeclNameArgumentsSyntax? { + get { + return arguments + } + set { + arguments = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedAfterArguments") + public var unexpectedAfterDeclNameArguments: UnexpectedNodesSyntax? { + get { + return unexpectedAfterArguments + } + set { + unexpectedAfterArguments = newValue + } + } + + @available(*, deprecated, message: "Use an initializer with baseName, arguments argument(s).") + @_disfavoredOverload + public init( + leadingTrivia: Trivia? = nil, + _ unexpectedBeforeDeclBaseName: UnexpectedNodesSyntax? = nil, + declBaseName: TokenSyntax, + _ unexpectedBetweenDeclBaseNameAndDeclNameArguments: UnexpectedNodesSyntax? = nil, + declNameArguments: DeclNameArgumentsSyntax? = nil, + _ unexpectedAfterDeclNameArguments: UnexpectedNodesSyntax? = nil, + trailingTrivia: Trivia? = nil + + ) { + self.init( + leadingTrivia: leadingTrivia, + unexpectedBeforeDeclBaseName, + baseName: declBaseName, + unexpectedBetweenDeclBaseNameAndDeclNameArguments, + arguments: declNameArguments, + unexpectedAfterDeclNameArguments, + trailingTrivia: trailingTrivia + ) + } +} + extension DerivativeRegistrationAttributeArgumentsSyntax { @available(*, deprecated, renamed: "unexpectedBetweenPeriodAndAccessorSpecifier") public var unexpectedBetweenPeriodAndAccessorKind: UnexpectedNodesSyntax? { @@ -1249,17 +1437,37 @@ extension DifferentiableAttributeArgumentsSyntax { } } - @available(*, deprecated, renamed: "unexpectedBetweenParametersCommaAndWhereClause") + @available(*, deprecated, renamed: "unexpectedBetweenParametersCommaAndGenericWhereClause") public var unexpectedBetweenDiffParamsCommaAndWhereClause: UnexpectedNodesSyntax? { get { - return unexpectedBetweenParametersCommaAndWhereClause + return unexpectedBetweenParametersCommaAndGenericWhereClause + } + set { + unexpectedBetweenParametersCommaAndGenericWhereClause = newValue + } + } + + @available(*, deprecated, renamed: "genericWhereClause") + public var whereClause: GenericWhereClauseSyntax? { + get { + return genericWhereClause } set { - unexpectedBetweenParametersCommaAndWhereClause = newValue + genericWhereClause = newValue } } - @available(*, deprecated, message: "Use an initializer with kindSpecifier, kindSpecifierComma, parameters, parametersComma argument(s).") + @available(*, deprecated, renamed: "unexpectedAfterGenericWhereClause") + public var unexpectedAfterWhereClause: UnexpectedNodesSyntax? { + get { + return unexpectedAfterGenericWhereClause + } + set { + unexpectedAfterGenericWhereClause = newValue + } + } + + @available(*, deprecated, message: "Use an initializer with kindSpecifier, kindSpecifierComma, parameters, parametersComma, genericWhereClause argument(s).") @_disfavoredOverload public init( leadingTrivia: Trivia? = nil, @@ -1288,7 +1496,7 @@ extension DifferentiableAttributeArgumentsSyntax { unexpectedBetweenDiffParamsAndDiffParamsComma, parametersComma: diffParamsComma, unexpectedBetweenDiffParamsCommaAndWhereClause, - whereClause: whereClause, + genericWhereClause: whereClause, unexpectedAfterWhereClause, trailingTrivia: trailingTrivia ) @@ -1551,6 +1759,95 @@ extension FloatLiteralExprSyntax { } } +extension FunctionSignatureSyntax { + @available(*, deprecated, renamed: "unexpectedBeforeParameterClause") + public var unexpectedBeforeInput: UnexpectedNodesSyntax? { + get { + return unexpectedBeforeParameterClause + } + set { + unexpectedBeforeParameterClause = newValue + } + } + + @available(*, deprecated, renamed: "parameterClause") + public var input: ParameterClauseSyntax { + get { + return parameterClause + } + set { + parameterClause = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenParameterClauseAndEffectSpecifiers") + public var unexpectedBetweenInputAndEffectSpecifiers: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenParameterClauseAndEffectSpecifiers + } + set { + unexpectedBetweenParameterClauseAndEffectSpecifiers = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenEffectSpecifiersAndReturnClause") + public var unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenEffectSpecifiersAndReturnClause + } + set { + unexpectedBetweenEffectSpecifiersAndReturnClause = newValue + } + } + + @available(*, deprecated, renamed: "returnClause") + public var output: ReturnClauseSyntax? { + get { + return returnClause + } + set { + returnClause = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedAfterReturnClause") + public var unexpectedAfterOutput: UnexpectedNodesSyntax? { + get { + return unexpectedAfterReturnClause + } + set { + unexpectedAfterReturnClause = newValue + } + } + + @available(*, deprecated, message: "Use an initializer with parameterClause, returnClause argument(s).") + @_disfavoredOverload + public init( + leadingTrivia: Trivia? = nil, + _ unexpectedBeforeInput: UnexpectedNodesSyntax? = nil, + input: ParameterClauseSyntax, + _ unexpectedBetweenInputAndEffectSpecifiers: UnexpectedNodesSyntax? = nil, + effectSpecifiers: FunctionEffectSpecifiersSyntax? = nil, + _ unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? = nil, + output: ReturnClauseSyntax? = nil, + _ unexpectedAfterOutput: UnexpectedNodesSyntax? = nil, + trailingTrivia: Trivia? = nil + + ) { + self.init( + leadingTrivia: leadingTrivia, + unexpectedBeforeInput, + parameterClause: input, + unexpectedBetweenInputAndEffectSpecifiers, + effectSpecifiers: effectSpecifiers, + unexpectedBetweenEffectSpecifiersAndOutput, + returnClause: output, + unexpectedAfterOutput, + trailingTrivia: trailingTrivia + ) + } +} + extension FunctionTypeSyntax { @available(*, deprecated, renamed: "unexpectedBetweenLeftParenAndParameters") public var unexpectedBetweenLeftParenAndarguments: UnexpectedNodesSyntax? { @@ -1587,7 +1884,37 @@ extension FunctionTypeSyntax { } } - @available(*, deprecated, message: "Use an initializer with parameters argument(s).") + @available(*, deprecated, renamed: "unexpectedBetweenEffectSpecifiersAndReturnClause") + public var unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenEffectSpecifiersAndReturnClause + } + set { + unexpectedBetweenEffectSpecifiersAndReturnClause = newValue + } + } + + @available(*, deprecated, renamed: "returnClause") + public var output: ReturnClauseSyntax { + get { + return returnClause + } + set { + returnClause = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedAfterReturnClause") + public var unexpectedAfterOutput: UnexpectedNodesSyntax? { + get { + return unexpectedAfterReturnClause + } + set { + unexpectedAfterReturnClause = newValue + } + } + + @available(*, deprecated, message: "Use an initializer with parameters, returnClause argument(s).") @_disfavoredOverload public init( leadingTrivia: Trivia? = nil, @@ -1616,7 +1943,7 @@ extension FunctionTypeSyntax { unexpectedBetweenRightParenAndEffectSpecifiers, effectSpecifiers: effectSpecifiers, unexpectedBetweenEffectSpecifiersAndOutput, - output: output, + returnClause: output, unexpectedAfterOutput, trailingTrivia: trailingTrivia ) @@ -2301,7 +2628,37 @@ extension MacroExpansionDeclSyntax { } } - @available(*, deprecated, message: "Use an initializer with pound argument(s).") + @available(*, deprecated, renamed: "unexpectedBetweenMacroAndGenericArgumentClause") + public var unexpectedBetweenMacroAndGenericArguments: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenMacroAndGenericArgumentClause + } + set { + unexpectedBetweenMacroAndGenericArgumentClause = newValue + } + } + + @available(*, deprecated, renamed: "genericArgumentClause") + public var genericArguments: GenericArgumentClauseSyntax? { + get { + return genericArgumentClause + } + set { + genericArgumentClause = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenGenericArgumentClauseAndLeftParen") + public var unexpectedBetweenGenericArgumentsAndLeftParen: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenGenericArgumentClauseAndLeftParen + } + set { + unexpectedBetweenGenericArgumentClauseAndLeftParen = newValue + } + } + + @available(*, deprecated, message: "Use an initializer with pound, genericArgumentClause argument(s).") @_disfavoredOverload public init( leadingTrivia: Trivia? = nil, @@ -2340,7 +2697,7 @@ extension MacroExpansionDeclSyntax { unexpectedBetweenPoundTokenAndMacro, macro: macro, unexpectedBetweenMacroAndGenericArguments, - genericArguments: genericArguments, + genericArgumentClause: genericArguments, unexpectedBetweenGenericArgumentsAndLeftParen, leftParen: leftParen, unexpectedBetweenLeftParenAndArgumentList, @@ -2388,7 +2745,37 @@ extension MacroExpansionExprSyntax { } } - @available(*, deprecated, message: "Use an initializer with pound argument(s).") + @available(*, deprecated, renamed: "unexpectedBetweenMacroAndGenericArgumentClause") + public var unexpectedBetweenMacroAndGenericArguments: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenMacroAndGenericArgumentClause + } + set { + unexpectedBetweenMacroAndGenericArgumentClause = newValue + } + } + + @available(*, deprecated, renamed: "genericArgumentClause") + public var genericArguments: GenericArgumentClauseSyntax? { + get { + return genericArgumentClause + } + set { + genericArgumentClause = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenGenericArgumentClauseAndLeftParen") + public var unexpectedBetweenGenericArgumentsAndLeftParen: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenGenericArgumentClauseAndLeftParen + } + set { + unexpectedBetweenGenericArgumentClauseAndLeftParen = newValue + } + } + + @available(*, deprecated, message: "Use an initializer with pound, genericArgumentClause argument(s).") @_disfavoredOverload public init( leadingTrivia: Trivia? = nil, @@ -2419,7 +2806,7 @@ extension MacroExpansionExprSyntax { unexpectedBetweenPoundTokenAndMacro, macro: macro, unexpectedBetweenMacroAndGenericArguments, - genericArguments: genericArguments, + genericArgumentClause: genericArguments, unexpectedBetweenGenericArgumentsAndLeftParen, leftParen: leftParen, unexpectedBetweenLeftParenAndArgumentList, @@ -3463,6 +3850,105 @@ extension SourceFileSyntax { } } +extension SubscriptDeclSyntax { + @available(*, deprecated, renamed: "unexpectedBetweenGenericParameterClauseAndParameterClause") + public var unexpectedBetweenGenericParameterClauseAndIndices: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenGenericParameterClauseAndParameterClause + } + set { + unexpectedBetweenGenericParameterClauseAndParameterClause = newValue + } + } + + @available(*, deprecated, renamed: "parameterClause") + public var indices: ParameterClauseSyntax { + get { + return parameterClause + } + set { + parameterClause = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenParameterClauseAndReturnClause") + public var unexpectedBetweenIndicesAndResult: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenParameterClauseAndReturnClause + } + set { + unexpectedBetweenParameterClauseAndReturnClause = newValue + } + } + + @available(*, deprecated, renamed: "returnClause") + public var result: ReturnClauseSyntax { + get { + return returnClause + } + set { + returnClause = newValue + } + } + + @available(*, deprecated, renamed: "unexpectedBetweenReturnClauseAndGenericWhereClause") + public var unexpectedBetweenResultAndGenericWhereClause: UnexpectedNodesSyntax? { + get { + return unexpectedBetweenReturnClauseAndGenericWhereClause + } + set { + unexpectedBetweenReturnClauseAndGenericWhereClause = newValue + } + } + + @available(*, deprecated, message: "Use an initializer with parameterClause, returnClause argument(s).") + @_disfavoredOverload + public init( + leadingTrivia: Trivia? = nil, + _ unexpectedBeforeAttributes: UnexpectedNodesSyntax? = nil, + attributes: AttributeListSyntax? = nil, + _ unexpectedBetweenAttributesAndModifiers: UnexpectedNodesSyntax? = nil, + modifiers: ModifierListSyntax? = nil, + _ unexpectedBetweenModifiersAndSubscriptKeyword: UnexpectedNodesSyntax? = nil, + subscriptKeyword: TokenSyntax = .keyword(.subscript), + _ unexpectedBetweenSubscriptKeywordAndGenericParameterClause: UnexpectedNodesSyntax? = nil, + genericParameterClause: GenericParameterClauseSyntax? = nil, + _ unexpectedBetweenGenericParameterClauseAndIndices: UnexpectedNodesSyntax? = nil, + indices: ParameterClauseSyntax, + _ unexpectedBetweenIndicesAndResult: UnexpectedNodesSyntax? = nil, + result: ReturnClauseSyntax, + _ unexpectedBetweenResultAndGenericWhereClause: UnexpectedNodesSyntax? = nil, + genericWhereClause: GenericWhereClauseSyntax? = nil, + _ unexpectedBetweenGenericWhereClauseAndAccessor: UnexpectedNodesSyntax? = nil, + accessor: Accessor? = nil, + _ unexpectedAfterAccessor: UnexpectedNodesSyntax? = nil, + trailingTrivia: Trivia? = nil + + ) { + self.init( + leadingTrivia: leadingTrivia, + unexpectedBeforeAttributes, + attributes: attributes, + unexpectedBetweenAttributesAndModifiers, + modifiers: modifiers, + unexpectedBetweenModifiersAndSubscriptKeyword, + subscriptKeyword: subscriptKeyword, + unexpectedBetweenSubscriptKeywordAndGenericParameterClause, + genericParameterClause: genericParameterClause, + unexpectedBetweenGenericParameterClauseAndIndices, + parameterClause: indices, + unexpectedBetweenIndicesAndResult, + returnClause: result, + unexpectedBetweenResultAndGenericWhereClause, + genericWhereClause: genericWhereClause, + unexpectedBetweenGenericWhereClauseAndAccessor, + accessor: accessor, + unexpectedAfterAccessor, + trailingTrivia: trailingTrivia + ) + } +} + extension SubscriptExprSyntax { @available(*, deprecated, renamed: "unexpectedBetweenCalledExpressionAndLeftSquare") public var unexpectedBetweenCalledExpressionAndLeftBracket: UnexpectedNodesSyntax? { diff --git a/Sources/SwiftSyntax/generated/SyntaxTraits.swift b/Sources/SwiftSyntax/generated/SyntaxTraits.swift index e20dfe2b854..713be263322 100644 --- a/Sources/SwiftSyntax/generated/SyntaxTraits.swift +++ b/Sources/SwiftSyntax/generated/SyntaxTraits.swift @@ -178,7 +178,7 @@ public protocol FreestandingMacroExpansionSyntax: SyntaxProtocol { set } - var genericArguments: GenericArgumentClauseSyntax? { + var genericArgumentClause: GenericArgumentClauseSyntax? { get set } diff --git a/Sources/SwiftSyntax/generated/raw/RawSyntaxNodes.swift b/Sources/SwiftSyntax/generated/raw/RawSyntaxNodes.swift index 3f7d0cf09a3..deb1ec69086 100644 --- a/Sources/SwiftSyntax/generated/raw/RawSyntaxNodes.swift +++ b/Sources/SwiftSyntax/generated/raw/RawSyntaxNodes.swift @@ -3004,9 +3004,9 @@ public struct RawCanImportVersionInfoSyntax: RawExprSyntaxNodeProtocol { label: RawTokenSyntax, _ unexpectedBetweenLabelAndColon: RawUnexpectedNodesSyntax? = nil, colon: RawTokenSyntax, - _ unexpectedBetweenColonAndVersionTuple: RawUnexpectedNodesSyntax? = nil, - versionTuple: RawVersionTupleSyntax, - _ unexpectedAfterVersionTuple: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBetweenColonAndVersion: RawUnexpectedNodesSyntax? = nil, + version: RawVersionTupleSyntax, + _ unexpectedAfterVersion: RawUnexpectedNodesSyntax? = nil, arena: __shared SyntaxArena ) { let raw = RawSyntax.makeLayout( @@ -3018,9 +3018,9 @@ public struct RawCanImportVersionInfoSyntax: RawExprSyntaxNodeProtocol { layout[3] = label.raw layout[4] = unexpectedBetweenLabelAndColon?.raw layout[5] = colon.raw - layout[6] = unexpectedBetweenColonAndVersionTuple?.raw - layout[7] = versionTuple.raw - layout[8] = unexpectedAfterVersionTuple?.raw + layout[6] = unexpectedBetweenColonAndVersion?.raw + layout[7] = version.raw + layout[8] = unexpectedAfterVersion?.raw } self.init(unchecked: raw) } @@ -3049,15 +3049,15 @@ public struct RawCanImportVersionInfoSyntax: RawExprSyntaxNodeProtocol { layoutView.children[5].map(RawTokenSyntax.init(raw:))! } - public var unexpectedBetweenColonAndVersionTuple: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenColonAndVersion: RawUnexpectedNodesSyntax? { layoutView.children[6].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var versionTuple: RawVersionTupleSyntax { + public var version: RawVersionTupleSyntax { layoutView.children[7].map(RawVersionTupleSyntax.init(raw:))! } - public var unexpectedAfterVersionTuple: RawUnexpectedNodesSyntax? { + public var unexpectedAfterVersion: RawUnexpectedNodesSyntax? { layoutView.children[8].map(RawUnexpectedNodesSyntax.init(raw:)) } } @@ -4480,9 +4480,9 @@ public struct RawClosureParameterSyntax: RawSyntaxNodeProtocol { @_spi(RawSyntax) public struct RawClosureSignatureSyntax: RawSyntaxNodeProtocol { - public enum Input: RawSyntaxNodeProtocol { + public enum ParameterClause: RawSyntaxNodeProtocol { case `simpleInput`(RawClosureParamListSyntax) - case `input`(RawClosureParameterClauseSyntax) + case `parameterClause`(RawClosureParameterClauseSyntax) public static func isKindOf(_ raw: RawSyntax) -> Bool { return RawClosureParamListSyntax.isKindOf(raw) || RawClosureParameterClauseSyntax.isKindOf(raw) @@ -4492,7 +4492,7 @@ public struct RawClosureSignatureSyntax: RawSyntaxNodeProtocol { switch self { case .simpleInput(let node): return node.raw - case .input(let node): + case .parameterClause(let node): return node.raw } } @@ -4503,7 +4503,7 @@ public struct RawClosureSignatureSyntax: RawSyntaxNodeProtocol { return } if let node = RawClosureParameterClauseSyntax(other) { - self = .input(node) + self = .parameterClause(node) return } return nil @@ -4542,13 +4542,13 @@ public struct RawClosureSignatureSyntax: RawSyntaxNodeProtocol { attributes: RawAttributeListSyntax?, _ unexpectedBetweenAttributesAndCapture: RawUnexpectedNodesSyntax? = nil, capture: RawClosureCaptureSignatureSyntax?, - _ unexpectedBetweenCaptureAndInput: RawUnexpectedNodesSyntax? = nil, - input: Input?, - _ unexpectedBetweenInputAndEffectSpecifiers: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBetweenCaptureAndParameterClause: RawUnexpectedNodesSyntax? = nil, + parameterClause: ParameterClause?, + _ unexpectedBetweenParameterClauseAndEffectSpecifiers: RawUnexpectedNodesSyntax? = nil, effectSpecifiers: RawTypeEffectSpecifiersSyntax?, - _ unexpectedBetweenEffectSpecifiersAndOutput: RawUnexpectedNodesSyntax? = nil, - output: RawReturnClauseSyntax?, - _ unexpectedBetweenOutputAndInKeyword: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBetweenEffectSpecifiersAndReturnClause: RawUnexpectedNodesSyntax? = nil, + returnClause: RawReturnClauseSyntax?, + _ unexpectedBetweenReturnClauseAndInKeyword: RawUnexpectedNodesSyntax? = nil, inKeyword: RawTokenSyntax, _ unexpectedAfterInKeyword: RawUnexpectedNodesSyntax? = nil, arena: __shared SyntaxArena @@ -4560,13 +4560,13 @@ public struct RawClosureSignatureSyntax: RawSyntaxNodeProtocol { layout[1] = attributes?.raw layout[2] = unexpectedBetweenAttributesAndCapture?.raw layout[3] = capture?.raw - layout[4] = unexpectedBetweenCaptureAndInput?.raw - layout[5] = input?.raw - layout[6] = unexpectedBetweenInputAndEffectSpecifiers?.raw + layout[4] = unexpectedBetweenCaptureAndParameterClause?.raw + layout[5] = parameterClause?.raw + layout[6] = unexpectedBetweenParameterClauseAndEffectSpecifiers?.raw layout[7] = effectSpecifiers?.raw - layout[8] = unexpectedBetweenEffectSpecifiersAndOutput?.raw - layout[9] = output?.raw - layout[10] = unexpectedBetweenOutputAndInKeyword?.raw + layout[8] = unexpectedBetweenEffectSpecifiersAndReturnClause?.raw + layout[9] = returnClause?.raw + layout[10] = unexpectedBetweenReturnClauseAndInKeyword?.raw layout[11] = inKeyword.raw layout[12] = unexpectedAfterInKeyword?.raw } @@ -4589,15 +4589,15 @@ public struct RawClosureSignatureSyntax: RawSyntaxNodeProtocol { layoutView.children[3].map(RawClosureCaptureSignatureSyntax.init(raw:)) } - public var unexpectedBetweenCaptureAndInput: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenCaptureAndParameterClause: RawUnexpectedNodesSyntax? { layoutView.children[4].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var input: RawSyntax? { + public var parameterClause: RawSyntax? { layoutView.children[5] } - public var unexpectedBetweenInputAndEffectSpecifiers: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenParameterClauseAndEffectSpecifiers: RawUnexpectedNodesSyntax? { layoutView.children[6].map(RawUnexpectedNodesSyntax.init(raw:)) } @@ -4605,15 +4605,15 @@ public struct RawClosureSignatureSyntax: RawSyntaxNodeProtocol { layoutView.children[7].map(RawTypeEffectSpecifiersSyntax.init(raw:)) } - public var unexpectedBetweenEffectSpecifiersAndOutput: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenEffectSpecifiersAndReturnClause: RawUnexpectedNodesSyntax? { layoutView.children[8].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var output: RawReturnClauseSyntax? { + public var returnClause: RawReturnClauseSyntax? { layoutView.children[9].map(RawReturnClauseSyntax.init(raw:)) } - public var unexpectedBetweenOutputAndInKeyword: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenReturnClauseAndInKeyword: RawUnexpectedNodesSyntax? { layoutView.children[10].map(RawUnexpectedNodesSyntax.init(raw:)) } @@ -6071,42 +6071,42 @@ public struct RawDeclNameSyntax: RawSyntaxNodeProtocol { } public init( - _ unexpectedBeforeDeclBaseName: RawUnexpectedNodesSyntax? = nil, - declBaseName: RawTokenSyntax, - _ unexpectedBetweenDeclBaseNameAndDeclNameArguments: RawUnexpectedNodesSyntax? = nil, - declNameArguments: RawDeclNameArgumentsSyntax?, - _ unexpectedAfterDeclNameArguments: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBeforeBaseName: RawUnexpectedNodesSyntax? = nil, + baseName: RawTokenSyntax, + _ unexpectedBetweenBaseNameAndArguments: RawUnexpectedNodesSyntax? = nil, + arguments: RawDeclNameArgumentsSyntax?, + _ unexpectedAfterArguments: RawUnexpectedNodesSyntax? = nil, arena: __shared SyntaxArena ) { let raw = RawSyntax.makeLayout( kind: .declName, uninitializedCount: 5, arena: arena) { layout in layout.initialize(repeating: nil) - layout[0] = unexpectedBeforeDeclBaseName?.raw - layout[1] = declBaseName.raw - layout[2] = unexpectedBetweenDeclBaseNameAndDeclNameArguments?.raw - layout[3] = declNameArguments?.raw - layout[4] = unexpectedAfterDeclNameArguments?.raw + layout[0] = unexpectedBeforeBaseName?.raw + layout[1] = baseName.raw + layout[2] = unexpectedBetweenBaseNameAndArguments?.raw + layout[3] = arguments?.raw + layout[4] = unexpectedAfterArguments?.raw } self.init(unchecked: raw) } - public var unexpectedBeforeDeclBaseName: RawUnexpectedNodesSyntax? { + public var unexpectedBeforeBaseName: RawUnexpectedNodesSyntax? { layoutView.children[0].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var declBaseName: RawTokenSyntax { + public var baseName: RawTokenSyntax { layoutView.children[1].map(RawTokenSyntax.init(raw:))! } - public var unexpectedBetweenDeclBaseNameAndDeclNameArguments: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenBaseNameAndArguments: RawUnexpectedNodesSyntax? { layoutView.children[2].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var declNameArguments: RawDeclNameArgumentsSyntax? { + public var arguments: RawDeclNameArgumentsSyntax? { layoutView.children[3].map(RawDeclNameArgumentsSyntax.init(raw:)) } - public var unexpectedAfterDeclNameArguments: RawUnexpectedNodesSyntax? { + public var unexpectedAfterArguments: RawUnexpectedNodesSyntax? { layoutView.children[4].map(RawUnexpectedNodesSyntax.init(raw:)) } } @@ -7348,9 +7348,9 @@ public struct RawDifferentiableAttributeArgumentsSyntax: RawSyntaxNodeProtocol { parameters: RawDifferentiabilityParamsClauseSyntax?, _ unexpectedBetweenParametersAndParametersComma: RawUnexpectedNodesSyntax? = nil, parametersComma: RawTokenSyntax?, - _ unexpectedBetweenParametersCommaAndWhereClause: RawUnexpectedNodesSyntax? = nil, - whereClause: RawGenericWhereClauseSyntax?, - _ unexpectedAfterWhereClause: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBetweenParametersCommaAndGenericWhereClause: RawUnexpectedNodesSyntax? = nil, + genericWhereClause: RawGenericWhereClauseSyntax?, + _ unexpectedAfterGenericWhereClause: RawUnexpectedNodesSyntax? = nil, arena: __shared SyntaxArena ) { let raw = RawSyntax.makeLayout( @@ -7364,9 +7364,9 @@ public struct RawDifferentiableAttributeArgumentsSyntax: RawSyntaxNodeProtocol { layout[5] = parameters?.raw layout[6] = unexpectedBetweenParametersAndParametersComma?.raw layout[7] = parametersComma?.raw - layout[8] = unexpectedBetweenParametersCommaAndWhereClause?.raw - layout[9] = whereClause?.raw - layout[10] = unexpectedAfterWhereClause?.raw + layout[8] = unexpectedBetweenParametersCommaAndGenericWhereClause?.raw + layout[9] = genericWhereClause?.raw + layout[10] = unexpectedAfterGenericWhereClause?.raw } self.init(unchecked: raw) } @@ -7403,15 +7403,15 @@ public struct RawDifferentiableAttributeArgumentsSyntax: RawSyntaxNodeProtocol { layoutView.children[7].map(RawTokenSyntax.init(raw:)) } - public var unexpectedBetweenParametersCommaAndWhereClause: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenParametersCommaAndGenericWhereClause: RawUnexpectedNodesSyntax? { layoutView.children[8].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var whereClause: RawGenericWhereClauseSyntax? { + public var genericWhereClause: RawGenericWhereClauseSyntax? { layoutView.children[9].map(RawGenericWhereClauseSyntax.init(raw:)) } - public var unexpectedAfterWhereClause: RawUnexpectedNodesSyntax? { + public var unexpectedAfterGenericWhereClause: RawUnexpectedNodesSyntax? { layoutView.children[10].map(RawUnexpectedNodesSyntax.init(raw:)) } } @@ -10153,38 +10153,38 @@ public struct RawFunctionSignatureSyntax: RawSyntaxNodeProtocol { } public init( - _ unexpectedBeforeInput: RawUnexpectedNodesSyntax? = nil, - input: RawParameterClauseSyntax, - _ unexpectedBetweenInputAndEffectSpecifiers: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBeforeParameterClause: RawUnexpectedNodesSyntax? = nil, + parameterClause: RawParameterClauseSyntax, + _ unexpectedBetweenParameterClauseAndEffectSpecifiers: RawUnexpectedNodesSyntax? = nil, effectSpecifiers: RawFunctionEffectSpecifiersSyntax?, - _ unexpectedBetweenEffectSpecifiersAndOutput: RawUnexpectedNodesSyntax? = nil, - output: RawReturnClauseSyntax?, - _ unexpectedAfterOutput: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBetweenEffectSpecifiersAndReturnClause: RawUnexpectedNodesSyntax? = nil, + returnClause: RawReturnClauseSyntax?, + _ unexpectedAfterReturnClause: RawUnexpectedNodesSyntax? = nil, arena: __shared SyntaxArena ) { let raw = RawSyntax.makeLayout( kind: .functionSignature, uninitializedCount: 7, arena: arena) { layout in layout.initialize(repeating: nil) - layout[0] = unexpectedBeforeInput?.raw - layout[1] = input.raw - layout[2] = unexpectedBetweenInputAndEffectSpecifiers?.raw + layout[0] = unexpectedBeforeParameterClause?.raw + layout[1] = parameterClause.raw + layout[2] = unexpectedBetweenParameterClauseAndEffectSpecifiers?.raw layout[3] = effectSpecifiers?.raw - layout[4] = unexpectedBetweenEffectSpecifiersAndOutput?.raw - layout[5] = output?.raw - layout[6] = unexpectedAfterOutput?.raw + layout[4] = unexpectedBetweenEffectSpecifiersAndReturnClause?.raw + layout[5] = returnClause?.raw + layout[6] = unexpectedAfterReturnClause?.raw } self.init(unchecked: raw) } - public var unexpectedBeforeInput: RawUnexpectedNodesSyntax? { + public var unexpectedBeforeParameterClause: RawUnexpectedNodesSyntax? { layoutView.children[0].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var input: RawParameterClauseSyntax { + public var parameterClause: RawParameterClauseSyntax { layoutView.children[1].map(RawParameterClauseSyntax.init(raw:))! } - public var unexpectedBetweenInputAndEffectSpecifiers: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenParameterClauseAndEffectSpecifiers: RawUnexpectedNodesSyntax? { layoutView.children[2].map(RawUnexpectedNodesSyntax.init(raw:)) } @@ -10192,15 +10192,15 @@ public struct RawFunctionSignatureSyntax: RawSyntaxNodeProtocol { layoutView.children[3].map(RawFunctionEffectSpecifiersSyntax.init(raw:)) } - public var unexpectedBetweenEffectSpecifiersAndOutput: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenEffectSpecifiersAndReturnClause: RawUnexpectedNodesSyntax? { layoutView.children[4].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var output: RawReturnClauseSyntax? { + public var returnClause: RawReturnClauseSyntax? { layoutView.children[5].map(RawReturnClauseSyntax.init(raw:)) } - public var unexpectedAfterOutput: RawUnexpectedNodesSyntax? { + public var unexpectedAfterReturnClause: RawUnexpectedNodesSyntax? { layoutView.children[6].map(RawUnexpectedNodesSyntax.init(raw:)) } } @@ -10243,9 +10243,9 @@ public struct RawFunctionTypeSyntax: RawTypeSyntaxNodeProtocol { rightParen: RawTokenSyntax, _ unexpectedBetweenRightParenAndEffectSpecifiers: RawUnexpectedNodesSyntax? = nil, effectSpecifiers: RawTypeEffectSpecifiersSyntax?, - _ unexpectedBetweenEffectSpecifiersAndOutput: RawUnexpectedNodesSyntax? = nil, - output: RawReturnClauseSyntax, - _ unexpectedAfterOutput: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBetweenEffectSpecifiersAndReturnClause: RawUnexpectedNodesSyntax? = nil, + returnClause: RawReturnClauseSyntax, + _ unexpectedAfterReturnClause: RawUnexpectedNodesSyntax? = nil, arena: __shared SyntaxArena ) { let raw = RawSyntax.makeLayout( @@ -10259,9 +10259,9 @@ public struct RawFunctionTypeSyntax: RawTypeSyntaxNodeProtocol { layout[5] = rightParen.raw layout[6] = unexpectedBetweenRightParenAndEffectSpecifiers?.raw layout[7] = effectSpecifiers?.raw - layout[8] = unexpectedBetweenEffectSpecifiersAndOutput?.raw - layout[9] = output.raw - layout[10] = unexpectedAfterOutput?.raw + layout[8] = unexpectedBetweenEffectSpecifiersAndReturnClause?.raw + layout[9] = returnClause.raw + layout[10] = unexpectedAfterReturnClause?.raw } self.init(unchecked: raw) } @@ -10298,15 +10298,15 @@ public struct RawFunctionTypeSyntax: RawTypeSyntaxNodeProtocol { layoutView.children[7].map(RawTypeEffectSpecifiersSyntax.init(raw:)) } - public var unexpectedBetweenEffectSpecifiersAndOutput: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenEffectSpecifiersAndReturnClause: RawUnexpectedNodesSyntax? { layoutView.children[8].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var output: RawReturnClauseSyntax { + public var returnClause: RawReturnClauseSyntax { layoutView.children[9].map(RawReturnClauseSyntax.init(raw:))! } - public var unexpectedAfterOutput: RawUnexpectedNodesSyntax? { + public var unexpectedAfterReturnClause: RawUnexpectedNodesSyntax? { layoutView.children[10].map(RawUnexpectedNodesSyntax.init(raw:)) } } @@ -13750,9 +13750,9 @@ public struct RawMacroExpansionDeclSyntax: RawDeclSyntaxNodeProtocol { pound: RawTokenSyntax, _ unexpectedBetweenPoundAndMacro: RawUnexpectedNodesSyntax? = nil, macro: RawTokenSyntax, - _ unexpectedBetweenMacroAndGenericArguments: RawUnexpectedNodesSyntax? = nil, - genericArguments: RawGenericArgumentClauseSyntax?, - _ unexpectedBetweenGenericArgumentsAndLeftParen: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBetweenMacroAndGenericArgumentClause: RawUnexpectedNodesSyntax? = nil, + genericArgumentClause: RawGenericArgumentClauseSyntax?, + _ unexpectedBetweenGenericArgumentClauseAndLeftParen: RawUnexpectedNodesSyntax? = nil, leftParen: RawTokenSyntax?, _ unexpectedBetweenLeftParenAndArgumentList: RawUnexpectedNodesSyntax? = nil, argumentList: RawTupleExprElementListSyntax, @@ -13776,9 +13776,9 @@ public struct RawMacroExpansionDeclSyntax: RawDeclSyntaxNodeProtocol { layout[5] = pound.raw layout[6] = unexpectedBetweenPoundAndMacro?.raw layout[7] = macro.raw - layout[8] = unexpectedBetweenMacroAndGenericArguments?.raw - layout[9] = genericArguments?.raw - layout[10] = unexpectedBetweenGenericArgumentsAndLeftParen?.raw + layout[8] = unexpectedBetweenMacroAndGenericArgumentClause?.raw + layout[9] = genericArgumentClause?.raw + layout[10] = unexpectedBetweenGenericArgumentClauseAndLeftParen?.raw layout[11] = leftParen?.raw layout[12] = unexpectedBetweenLeftParenAndArgumentList?.raw layout[13] = argumentList.raw @@ -13825,15 +13825,15 @@ public struct RawMacroExpansionDeclSyntax: RawDeclSyntaxNodeProtocol { layoutView.children[7].map(RawTokenSyntax.init(raw:))! } - public var unexpectedBetweenMacroAndGenericArguments: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenMacroAndGenericArgumentClause: RawUnexpectedNodesSyntax? { layoutView.children[8].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var genericArguments: RawGenericArgumentClauseSyntax? { + public var genericArgumentClause: RawGenericArgumentClauseSyntax? { layoutView.children[9].map(RawGenericArgumentClauseSyntax.init(raw:)) } - public var unexpectedBetweenGenericArgumentsAndLeftParen: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenGenericArgumentClauseAndLeftParen: RawUnexpectedNodesSyntax? { layoutView.children[10].map(RawUnexpectedNodesSyntax.init(raw:)) } @@ -13912,9 +13912,9 @@ public struct RawMacroExpansionExprSyntax: RawExprSyntaxNodeProtocol { pound: RawTokenSyntax, _ unexpectedBetweenPoundAndMacro: RawUnexpectedNodesSyntax? = nil, macro: RawTokenSyntax, - _ unexpectedBetweenMacroAndGenericArguments: RawUnexpectedNodesSyntax? = nil, - genericArguments: RawGenericArgumentClauseSyntax?, - _ unexpectedBetweenGenericArgumentsAndLeftParen: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBetweenMacroAndGenericArgumentClause: RawUnexpectedNodesSyntax? = nil, + genericArgumentClause: RawGenericArgumentClauseSyntax?, + _ unexpectedBetweenGenericArgumentClauseAndLeftParen: RawUnexpectedNodesSyntax? = nil, leftParen: RawTokenSyntax?, _ unexpectedBetweenLeftParenAndArgumentList: RawUnexpectedNodesSyntax? = nil, argumentList: RawTupleExprElementListSyntax, @@ -13934,9 +13934,9 @@ public struct RawMacroExpansionExprSyntax: RawExprSyntaxNodeProtocol { layout[1] = pound.raw layout[2] = unexpectedBetweenPoundAndMacro?.raw layout[3] = macro.raw - layout[4] = unexpectedBetweenMacroAndGenericArguments?.raw - layout[5] = genericArguments?.raw - layout[6] = unexpectedBetweenGenericArgumentsAndLeftParen?.raw + layout[4] = unexpectedBetweenMacroAndGenericArgumentClause?.raw + layout[5] = genericArgumentClause?.raw + layout[6] = unexpectedBetweenGenericArgumentClauseAndLeftParen?.raw layout[7] = leftParen?.raw layout[8] = unexpectedBetweenLeftParenAndArgumentList?.raw layout[9] = argumentList.raw @@ -13967,15 +13967,15 @@ public struct RawMacroExpansionExprSyntax: RawExprSyntaxNodeProtocol { layoutView.children[3].map(RawTokenSyntax.init(raw:))! } - public var unexpectedBetweenMacroAndGenericArguments: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenMacroAndGenericArgumentClause: RawUnexpectedNodesSyntax? { layoutView.children[4].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var genericArguments: RawGenericArgumentClauseSyntax? { + public var genericArgumentClause: RawGenericArgumentClauseSyntax? { layoutView.children[5].map(RawGenericArgumentClauseSyntax.init(raw:)) } - public var unexpectedBetweenGenericArgumentsAndLeftParen: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenGenericArgumentClauseAndLeftParen: RawUnexpectedNodesSyntax? { layoutView.children[6].map(RawUnexpectedNodesSyntax.init(raw:)) } @@ -19375,11 +19375,11 @@ public struct RawSubscriptDeclSyntax: RawDeclSyntaxNodeProtocol { subscriptKeyword: RawTokenSyntax, _ unexpectedBetweenSubscriptKeywordAndGenericParameterClause: RawUnexpectedNodesSyntax? = nil, genericParameterClause: RawGenericParameterClauseSyntax?, - _ unexpectedBetweenGenericParameterClauseAndIndices: RawUnexpectedNodesSyntax? = nil, - indices: RawParameterClauseSyntax, - _ unexpectedBetweenIndicesAndResult: RawUnexpectedNodesSyntax? = nil, - result: RawReturnClauseSyntax, - _ unexpectedBetweenResultAndGenericWhereClause: RawUnexpectedNodesSyntax? = nil, + _ unexpectedBetweenGenericParameterClauseAndParameterClause: RawUnexpectedNodesSyntax? = nil, + parameterClause: RawParameterClauseSyntax, + _ unexpectedBetweenParameterClauseAndReturnClause: RawUnexpectedNodesSyntax? = nil, + returnClause: RawReturnClauseSyntax, + _ unexpectedBetweenReturnClauseAndGenericWhereClause: RawUnexpectedNodesSyntax? = nil, genericWhereClause: RawGenericWhereClauseSyntax?, _ unexpectedBetweenGenericWhereClauseAndAccessor: RawUnexpectedNodesSyntax? = nil, accessor: Accessor?, @@ -19397,11 +19397,11 @@ public struct RawSubscriptDeclSyntax: RawDeclSyntaxNodeProtocol { layout[5] = subscriptKeyword.raw layout[6] = unexpectedBetweenSubscriptKeywordAndGenericParameterClause?.raw layout[7] = genericParameterClause?.raw - layout[8] = unexpectedBetweenGenericParameterClauseAndIndices?.raw - layout[9] = indices.raw - layout[10] = unexpectedBetweenIndicesAndResult?.raw - layout[11] = result.raw - layout[12] = unexpectedBetweenResultAndGenericWhereClause?.raw + layout[8] = unexpectedBetweenGenericParameterClauseAndParameterClause?.raw + layout[9] = parameterClause.raw + layout[10] = unexpectedBetweenParameterClauseAndReturnClause?.raw + layout[11] = returnClause.raw + layout[12] = unexpectedBetweenReturnClauseAndGenericWhereClause?.raw layout[13] = genericWhereClause?.raw layout[14] = unexpectedBetweenGenericWhereClauseAndAccessor?.raw layout[15] = accessor?.raw @@ -19442,23 +19442,23 @@ public struct RawSubscriptDeclSyntax: RawDeclSyntaxNodeProtocol { layoutView.children[7].map(RawGenericParameterClauseSyntax.init(raw:)) } - public var unexpectedBetweenGenericParameterClauseAndIndices: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenGenericParameterClauseAndParameterClause: RawUnexpectedNodesSyntax? { layoutView.children[8].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var indices: RawParameterClauseSyntax { + public var parameterClause: RawParameterClauseSyntax { layoutView.children[9].map(RawParameterClauseSyntax.init(raw:))! } - public var unexpectedBetweenIndicesAndResult: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenParameterClauseAndReturnClause: RawUnexpectedNodesSyntax? { layoutView.children[10].map(RawUnexpectedNodesSyntax.init(raw:)) } - public var result: RawReturnClauseSyntax { + public var returnClause: RawReturnClauseSyntax { layoutView.children[11].map(RawReturnClauseSyntax.init(raw:))! } - public var unexpectedBetweenResultAndGenericWhereClause: RawUnexpectedNodesSyntax? { + public var unexpectedBetweenReturnClauseAndGenericWhereClause: RawUnexpectedNodesSyntax? { layoutView.children[12].map(RawUnexpectedNodesSyntax.init(raw:)) } diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxDeclNodes.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxDeclNodes.swift index 2123e16f157..13333deb8d4 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxDeclNodes.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxDeclNodes.swift @@ -4202,7 +4202,7 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { /// - `modifiers`: ``ModifierListSyntax`` /// - `pound`: `'#'` /// - `macro`: `` -/// - `genericArguments`: ``GenericArgumentClauseSyntax``? +/// - `genericArgumentClause`: ``GenericArgumentClauseSyntax``? /// - `leftParen`: `'('`? /// - `argumentList`: ``TupleExprElementListSyntax`` /// - `rightParen`: `')'`? @@ -4240,9 +4240,9 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { pound: TokenSyntax = .poundToken(), _ unexpectedBetweenPoundAndMacro: UnexpectedNodesSyntax? = nil, macro: TokenSyntax, - _ unexpectedBetweenMacroAndGenericArguments: UnexpectedNodesSyntax? = nil, - genericArguments: GenericArgumentClauseSyntax? = nil, - _ unexpectedBetweenGenericArgumentsAndLeftParen: UnexpectedNodesSyntax? = nil, + _ unexpectedBetweenMacroAndGenericArgumentClause: UnexpectedNodesSyntax? = nil, + genericArgumentClause: GenericArgumentClauseSyntax? = nil, + _ unexpectedBetweenGenericArgumentClauseAndLeftParen: UnexpectedNodesSyntax? = nil, leftParen: TokenSyntax? = nil, _ unexpectedBetweenLeftParenAndArgumentList: UnexpectedNodesSyntax? = nil, argumentList: TupleExprElementListSyntax, @@ -4267,9 +4267,9 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { pound, unexpectedBetweenPoundAndMacro, macro, - unexpectedBetweenMacroAndGenericArguments, - genericArguments, - unexpectedBetweenGenericArgumentsAndLeftParen, + unexpectedBetweenMacroAndGenericArgumentClause, + genericArgumentClause, + unexpectedBetweenGenericArgumentClauseAndLeftParen, leftParen, unexpectedBetweenLeftParenAndArgumentList, argumentList, @@ -4290,9 +4290,9 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { pound.raw, unexpectedBetweenPoundAndMacro?.raw, macro.raw, - unexpectedBetweenMacroAndGenericArguments?.raw, - genericArguments?.raw, - unexpectedBetweenGenericArgumentsAndLeftParen?.raw, + unexpectedBetweenMacroAndGenericArgumentClause?.raw, + genericArgumentClause?.raw, + unexpectedBetweenGenericArgumentClauseAndLeftParen?.raw, leftParen?.raw, unexpectedBetweenLeftParenAndArgumentList?.raw, argumentList.raw, @@ -4438,7 +4438,7 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenMacroAndGenericArguments: UnexpectedNodesSyntax? { + public var unexpectedBetweenMacroAndGenericArgumentClause: UnexpectedNodesSyntax? { get { return data.child(at: 8, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -4447,7 +4447,7 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { } } - public var genericArguments: GenericArgumentClauseSyntax? { + public var genericArgumentClause: GenericArgumentClauseSyntax? { get { return data.child(at: 9, parent: Syntax(self)).map(GenericArgumentClauseSyntax.init) } @@ -4456,7 +4456,7 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenGenericArgumentsAndLeftParen: UnexpectedNodesSyntax? { + public var unexpectedBetweenGenericArgumentClauseAndLeftParen: UnexpectedNodesSyntax? { get { return data.child(at: 10, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -4613,9 +4613,9 @@ public struct MacroExpansionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { \Self.pound, \Self.unexpectedBetweenPoundAndMacro, \Self.macro, - \Self.unexpectedBetweenMacroAndGenericArguments, - \Self.genericArguments, - \Self.unexpectedBetweenGenericArgumentsAndLeftParen, + \Self.unexpectedBetweenMacroAndGenericArgumentClause, + \Self.genericArgumentClause, + \Self.unexpectedBetweenGenericArgumentClauseAndLeftParen, \Self.leftParen, \Self.unexpectedBetweenLeftParenAndArgumentList, \Self.argumentList, @@ -6304,8 +6304,8 @@ public struct StructDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { /// - `modifiers`: ``ModifierListSyntax`` /// - `subscriptKeyword`: `'subscript'` /// - `genericParameterClause`: ``GenericParameterClauseSyntax``? -/// - `indices`: ``ParameterClauseSyntax`` -/// - `result`: ``ReturnClauseSyntax`` +/// - `parameterClause`: ``ParameterClauseSyntax`` +/// - `returnClause`: ``ReturnClauseSyntax`` /// - `genericWhereClause`: ``GenericWhereClauseSyntax``? /// - `accessor`: (``AccessorBlockSyntax`` | ``CodeBlockSyntax``)? public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { @@ -6381,11 +6381,11 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { subscriptKeyword: TokenSyntax = .keyword(.subscript), _ unexpectedBetweenSubscriptKeywordAndGenericParameterClause: UnexpectedNodesSyntax? = nil, genericParameterClause: GenericParameterClauseSyntax? = nil, - _ unexpectedBetweenGenericParameterClauseAndIndices: UnexpectedNodesSyntax? = nil, - indices: ParameterClauseSyntax, - _ unexpectedBetweenIndicesAndResult: UnexpectedNodesSyntax? = nil, - result: ReturnClauseSyntax, - _ unexpectedBetweenResultAndGenericWhereClause: UnexpectedNodesSyntax? = nil, + _ unexpectedBetweenGenericParameterClauseAndParameterClause: UnexpectedNodesSyntax? = nil, + parameterClause: ParameterClauseSyntax, + _ unexpectedBetweenParameterClauseAndReturnClause: UnexpectedNodesSyntax? = nil, + returnClause: ReturnClauseSyntax, + _ unexpectedBetweenReturnClauseAndGenericWhereClause: UnexpectedNodesSyntax? = nil, genericWhereClause: GenericWhereClauseSyntax? = nil, _ unexpectedBetweenGenericWhereClauseAndAccessor: UnexpectedNodesSyntax? = nil, accessor: Accessor? = nil, @@ -6404,11 +6404,11 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { subscriptKeyword, unexpectedBetweenSubscriptKeywordAndGenericParameterClause, genericParameterClause, - unexpectedBetweenGenericParameterClauseAndIndices, - indices, - unexpectedBetweenIndicesAndResult, - result, - unexpectedBetweenResultAndGenericWhereClause, + unexpectedBetweenGenericParameterClauseAndParameterClause, + parameterClause, + unexpectedBetweenParameterClauseAndReturnClause, + returnClause, + unexpectedBetweenReturnClauseAndGenericWhereClause, genericWhereClause, unexpectedBetweenGenericWhereClauseAndAccessor, accessor, @@ -6423,11 +6423,11 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { subscriptKeyword.raw, unexpectedBetweenSubscriptKeywordAndGenericParameterClause?.raw, genericParameterClause?.raw, - unexpectedBetweenGenericParameterClauseAndIndices?.raw, - indices.raw, - unexpectedBetweenIndicesAndResult?.raw, - result.raw, - unexpectedBetweenResultAndGenericWhereClause?.raw, + unexpectedBetweenGenericParameterClauseAndParameterClause?.raw, + parameterClause.raw, + unexpectedBetweenParameterClauseAndReturnClause?.raw, + returnClause.raw, + unexpectedBetweenReturnClauseAndGenericWhereClause?.raw, genericWhereClause?.raw, unexpectedBetweenGenericWhereClauseAndAccessor?.raw, accessor?.raw, @@ -6566,7 +6566,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenGenericParameterClauseAndIndices: UnexpectedNodesSyntax? { + public var unexpectedBetweenGenericParameterClauseAndParameterClause: UnexpectedNodesSyntax? { get { return data.child(at: 8, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -6575,7 +6575,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { } } - public var indices: ParameterClauseSyntax { + public var parameterClause: ParameterClauseSyntax { get { return ParameterClauseSyntax(data.child(at: 9, parent: Syntax(self))!) } @@ -6584,7 +6584,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenIndicesAndResult: UnexpectedNodesSyntax? { + public var unexpectedBetweenParameterClauseAndReturnClause: UnexpectedNodesSyntax? { get { return data.child(at: 10, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -6593,7 +6593,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { } } - public var result: ReturnClauseSyntax { + public var returnClause: ReturnClauseSyntax { get { return ReturnClauseSyntax(data.child(at: 11, parent: Syntax(self))!) } @@ -6602,7 +6602,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenResultAndGenericWhereClause: UnexpectedNodesSyntax? { + public var unexpectedBetweenReturnClauseAndGenericWhereClause: UnexpectedNodesSyntax? { get { return data.child(at: 12, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -6657,11 +6657,11 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable { \Self.subscriptKeyword, \Self.unexpectedBetweenSubscriptKeywordAndGenericParameterClause, \Self.genericParameterClause, - \Self.unexpectedBetweenGenericParameterClauseAndIndices, - \Self.indices, - \Self.unexpectedBetweenIndicesAndResult, - \Self.result, - \Self.unexpectedBetweenResultAndGenericWhereClause, + \Self.unexpectedBetweenGenericParameterClauseAndParameterClause, + \Self.parameterClause, + \Self.unexpectedBetweenParameterClauseAndReturnClause, + \Self.returnClause, + \Self.unexpectedBetweenReturnClauseAndGenericWhereClause, \Self.genericWhereClause, \Self.unexpectedBetweenGenericWhereClauseAndAccessor, \Self.accessor, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxExprNodes.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxExprNodes.swift index facc73a1177..23c42c25a64 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxExprNodes.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxExprNodes.swift @@ -1206,7 +1206,7 @@ public struct CanImportExprSyntax: ExprSyntaxProtocol, SyntaxHashable { /// - `comma`: `','` /// - `label`: (`'_version'` | `'_underlyingVersion'`) /// - `colon`: `':'` -/// - `versionTuple`: ``VersionTupleSyntax`` +/// - `version`: ``VersionTupleSyntax`` public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable { public let _syntaxNode: Syntax @@ -1236,9 +1236,9 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable { label: TokenSyntax, _ unexpectedBetweenLabelAndColon: UnexpectedNodesSyntax? = nil, colon: TokenSyntax = .colonToken(), - _ unexpectedBetweenColonAndVersionTuple: UnexpectedNodesSyntax? = nil, - versionTuple: VersionTupleSyntax, - _ unexpectedAfterVersionTuple: UnexpectedNodesSyntax? = nil, + _ unexpectedBetweenColonAndVersion: UnexpectedNodesSyntax? = nil, + version: VersionTupleSyntax, + _ unexpectedAfterVersion: UnexpectedNodesSyntax? = nil, trailingTrivia: Trivia? = nil ) { @@ -1251,9 +1251,9 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable { label, unexpectedBetweenLabelAndColon, colon, - unexpectedBetweenColonAndVersionTuple, - versionTuple, - unexpectedAfterVersionTuple + unexpectedBetweenColonAndVersion, + version, + unexpectedAfterVersion ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeComma?.raw, @@ -1262,9 +1262,9 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable { label.raw, unexpectedBetweenLabelAndColon?.raw, colon.raw, - unexpectedBetweenColonAndVersionTuple?.raw, - versionTuple.raw, - unexpectedAfterVersionTuple?.raw + unexpectedBetweenColonAndVersion?.raw, + version.raw, + unexpectedAfterVersion?.raw ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.canImportVersionInfo, @@ -1333,7 +1333,7 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenColonAndVersionTuple: UnexpectedNodesSyntax? { + public var unexpectedBetweenColonAndVersion: UnexpectedNodesSyntax? { get { return data.child(at: 6, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -1342,7 +1342,7 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable { } } - public var versionTuple: VersionTupleSyntax { + public var version: VersionTupleSyntax { get { return VersionTupleSyntax(data.child(at: 7, parent: Syntax(self))!) } @@ -1351,7 +1351,7 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable { } } - public var unexpectedAfterVersionTuple: UnexpectedNodesSyntax? { + public var unexpectedAfterVersion: UnexpectedNodesSyntax? { get { return data.child(at: 8, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -1368,9 +1368,9 @@ public struct CanImportVersionInfoSyntax: ExprSyntaxProtocol, SyntaxHashable { \Self.label, \Self.unexpectedBetweenLabelAndColon, \Self.colon, - \Self.unexpectedBetweenColonAndVersionTuple, - \Self.versionTuple, - \Self.unexpectedAfterVersionTuple + \Self.unexpectedBetweenColonAndVersion, + \Self.version, + \Self.unexpectedAfterVersion ]) } } @@ -3654,7 +3654,7 @@ public struct KeyPathExprSyntax: ExprSyntaxProtocol, SyntaxHashable { /// /// - `pound`: `'#'` /// - `macro`: `` -/// - `genericArguments`: ``GenericArgumentClauseSyntax``? +/// - `genericArgumentClause`: ``GenericArgumentClauseSyntax``? /// - `leftParen`: `'('`? /// - `argumentList`: ``TupleExprElementListSyntax`` /// - `rightParen`: `')'`? @@ -3688,9 +3688,9 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable { pound: TokenSyntax = .poundToken(), _ unexpectedBetweenPoundAndMacro: UnexpectedNodesSyntax? = nil, macro: TokenSyntax, - _ unexpectedBetweenMacroAndGenericArguments: UnexpectedNodesSyntax? = nil, - genericArguments: GenericArgumentClauseSyntax? = nil, - _ unexpectedBetweenGenericArgumentsAndLeftParen: UnexpectedNodesSyntax? = nil, + _ unexpectedBetweenMacroAndGenericArgumentClause: UnexpectedNodesSyntax? = nil, + genericArgumentClause: GenericArgumentClauseSyntax? = nil, + _ unexpectedBetweenGenericArgumentClauseAndLeftParen: UnexpectedNodesSyntax? = nil, leftParen: TokenSyntax? = nil, _ unexpectedBetweenLeftParenAndArgumentList: UnexpectedNodesSyntax? = nil, argumentList: TupleExprElementListSyntax, @@ -3711,9 +3711,9 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable { pound, unexpectedBetweenPoundAndMacro, macro, - unexpectedBetweenMacroAndGenericArguments, - genericArguments, - unexpectedBetweenGenericArgumentsAndLeftParen, + unexpectedBetweenMacroAndGenericArgumentClause, + genericArgumentClause, + unexpectedBetweenGenericArgumentClauseAndLeftParen, leftParen, unexpectedBetweenLeftParenAndArgumentList, argumentList, @@ -3730,9 +3730,9 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable { pound.raw, unexpectedBetweenPoundAndMacro?.raw, macro.raw, - unexpectedBetweenMacroAndGenericArguments?.raw, - genericArguments?.raw, - unexpectedBetweenGenericArgumentsAndLeftParen?.raw, + unexpectedBetweenMacroAndGenericArgumentClause?.raw, + genericArgumentClause?.raw, + unexpectedBetweenGenericArgumentClauseAndLeftParen?.raw, leftParen?.raw, unexpectedBetweenLeftParenAndArgumentList?.raw, argumentList.raw, @@ -3794,7 +3794,7 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenMacroAndGenericArguments: UnexpectedNodesSyntax? { + public var unexpectedBetweenMacroAndGenericArgumentClause: UnexpectedNodesSyntax? { get { return data.child(at: 4, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -3803,7 +3803,7 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable { } } - public var genericArguments: GenericArgumentClauseSyntax? { + public var genericArgumentClause: GenericArgumentClauseSyntax? { get { return data.child(at: 5, parent: Syntax(self)).map(GenericArgumentClauseSyntax.init) } @@ -3812,7 +3812,7 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenGenericArgumentsAndLeftParen: UnexpectedNodesSyntax? { + public var unexpectedBetweenGenericArgumentClauseAndLeftParen: UnexpectedNodesSyntax? { get { return data.child(at: 6, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -3965,9 +3965,9 @@ public struct MacroExpansionExprSyntax: ExprSyntaxProtocol, SyntaxHashable { \Self.pound, \Self.unexpectedBetweenPoundAndMacro, \Self.macro, - \Self.unexpectedBetweenMacroAndGenericArguments, - \Self.genericArguments, - \Self.unexpectedBetweenGenericArgumentsAndLeftParen, + \Self.unexpectedBetweenMacroAndGenericArgumentClause, + \Self.genericArgumentClause, + \Self.unexpectedBetweenGenericArgumentClauseAndLeftParen, \Self.leftParen, \Self.unexpectedBetweenLeftParenAndArgumentList, \Self.argumentList, diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodes.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodes.swift index 3609e02c28a..07efd8026c3 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodes.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodes.swift @@ -4303,20 +4303,20 @@ public struct ClosureParameterSyntax: SyntaxProtocol, SyntaxHashable { /// /// - `attributes`: ``AttributeListSyntax`` /// - `capture`: ``ClosureCaptureSignatureSyntax``? -/// - `input`: (``ClosureParamListSyntax`` | ``ClosureParameterClauseSyntax``)? +/// - `parameterClause`: (``ClosureParamListSyntax`` | ``ClosureParameterClauseSyntax``)? /// - `effectSpecifiers`: ``TypeEffectSpecifiersSyntax``? -/// - `output`: ``ReturnClauseSyntax``? +/// - `returnClause`: ``ReturnClauseSyntax``? /// - `inKeyword`: `'in'` public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { - public enum Input: SyntaxChildChoices { + public enum ParameterClause: SyntaxChildChoices { case `simpleInput`(ClosureParamListSyntax) - case `input`(ClosureParameterClauseSyntax) + case `parameterClause`(ClosureParameterClauseSyntax) public var _syntaxNode: Syntax { switch self { case .simpleInput(let node): return node._syntaxNode - case .input(let node): + case .parameterClause(let node): return node._syntaxNode } } @@ -4330,7 +4330,7 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { } public init(_ node: ClosureParameterClauseSyntax) { - self = .input(node) + self = .parameterClause(node) } public init?(_ node: some SyntaxProtocol) { @@ -4339,7 +4339,7 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { return } if let node = node.as(ClosureParameterClauseSyntax.self) { - self = .input(node) + self = .parameterClause(node) return } return nil @@ -4376,13 +4376,13 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { attributes: AttributeListSyntax? = nil, _ unexpectedBetweenAttributesAndCapture: UnexpectedNodesSyntax? = nil, capture: ClosureCaptureSignatureSyntax? = nil, - _ unexpectedBetweenCaptureAndInput: UnexpectedNodesSyntax? = nil, - input: Input? = nil, - _ unexpectedBetweenInputAndEffectSpecifiers: UnexpectedNodesSyntax? = nil, + _ unexpectedBetweenCaptureAndParameterClause: UnexpectedNodesSyntax? = nil, + parameterClause: ParameterClause? = nil, + _ unexpectedBetweenParameterClauseAndEffectSpecifiers: UnexpectedNodesSyntax? = nil, effectSpecifiers: TypeEffectSpecifiersSyntax? = nil, - _ unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? = nil, - output: ReturnClauseSyntax? = nil, - _ unexpectedBetweenOutputAndInKeyword: UnexpectedNodesSyntax? = nil, + _ unexpectedBetweenEffectSpecifiersAndReturnClause: UnexpectedNodesSyntax? = nil, + returnClause: ReturnClauseSyntax? = nil, + _ unexpectedBetweenReturnClauseAndInKeyword: UnexpectedNodesSyntax? = nil, inKeyword: TokenSyntax = .keyword(.in), _ unexpectedAfterInKeyword: UnexpectedNodesSyntax? = nil, trailingTrivia: Trivia? = nil @@ -4395,13 +4395,13 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { attributes, unexpectedBetweenAttributesAndCapture, capture, - unexpectedBetweenCaptureAndInput, - input, - unexpectedBetweenInputAndEffectSpecifiers, + unexpectedBetweenCaptureAndParameterClause, + parameterClause, + unexpectedBetweenParameterClauseAndEffectSpecifiers, effectSpecifiers, - unexpectedBetweenEffectSpecifiersAndOutput, - output, - unexpectedBetweenOutputAndInKeyword, + unexpectedBetweenEffectSpecifiersAndReturnClause, + returnClause, + unexpectedBetweenReturnClauseAndInKeyword, inKeyword, unexpectedAfterInKeyword ))) { (arena, _) in @@ -4410,13 +4410,13 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { attributes?.raw, unexpectedBetweenAttributesAndCapture?.raw, capture?.raw, - unexpectedBetweenCaptureAndInput?.raw, - input?.raw, - unexpectedBetweenInputAndEffectSpecifiers?.raw, + unexpectedBetweenCaptureAndParameterClause?.raw, + parameterClause?.raw, + unexpectedBetweenParameterClauseAndEffectSpecifiers?.raw, effectSpecifiers?.raw, - unexpectedBetweenEffectSpecifiersAndOutput?.raw, - output?.raw, - unexpectedBetweenOutputAndInKeyword?.raw, + unexpectedBetweenEffectSpecifiersAndReturnClause?.raw, + returnClause?.raw, + unexpectedBetweenReturnClauseAndInKeyword?.raw, inKeyword.raw, unexpectedAfterInKeyword?.raw ] @@ -4493,7 +4493,7 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenCaptureAndInput: UnexpectedNodesSyntax? { + public var unexpectedBetweenCaptureAndParameterClause: UnexpectedNodesSyntax? { get { return data.child(at: 4, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -4502,16 +4502,16 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var input: Input? { + public var parameterClause: ParameterClause? { get { - return data.child(at: 5, parent: Syntax(self)).map(Input.init) + return data.child(at: 5, parent: Syntax(self)).map(ParameterClause.init) } set(value) { self = ClosureSignatureSyntax(data.replacingChild(at: 5, with: value?.data, arena: SyntaxArena())) } } - public var unexpectedBetweenInputAndEffectSpecifiers: UnexpectedNodesSyntax? { + public var unexpectedBetweenParameterClauseAndEffectSpecifiers: UnexpectedNodesSyntax? { get { return data.child(at: 6, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -4529,7 +4529,7 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? { + public var unexpectedBetweenEffectSpecifiersAndReturnClause: UnexpectedNodesSyntax? { get { return data.child(at: 8, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -4538,7 +4538,7 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var output: ReturnClauseSyntax? { + public var returnClause: ReturnClauseSyntax? { get { return data.child(at: 9, parent: Syntax(self)).map(ReturnClauseSyntax.init) } @@ -4547,7 +4547,7 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenOutputAndInKeyword: UnexpectedNodesSyntax? { + public var unexpectedBetweenReturnClauseAndInKeyword: UnexpectedNodesSyntax? { get { return data.child(at: 10, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -4580,13 +4580,13 @@ public struct ClosureSignatureSyntax: SyntaxProtocol, SyntaxHashable { \Self.attributes, \Self.unexpectedBetweenAttributesAndCapture, \Self.capture, - \Self.unexpectedBetweenCaptureAndInput, - \Self.input, - \Self.unexpectedBetweenInputAndEffectSpecifiers, + \Self.unexpectedBetweenCaptureAndParameterClause, + \Self.parameterClause, + \Self.unexpectedBetweenParameterClauseAndEffectSpecifiers, \Self.effectSpecifiers, - \Self.unexpectedBetweenEffectSpecifiersAndOutput, - \Self.output, - \Self.unexpectedBetweenOutputAndInKeyword, + \Self.unexpectedBetweenEffectSpecifiersAndReturnClause, + \Self.returnClause, + \Self.unexpectedBetweenReturnClauseAndInKeyword, \Self.inKeyword, \Self.unexpectedAfterInKeyword ]) @@ -6355,8 +6355,8 @@ public struct DeclNameArgumentsSyntax: SyntaxProtocol, SyntaxHashable { /// ### Children /// -/// - `declBaseName`: (`` | `` | `'init'` | `'self'` | `'Self'`) -/// - `declNameArguments`: ``DeclNameArgumentsSyntax``? +/// - `baseName`: (`` | `` | `'init'` | `'self'` | `'Self'`) +/// - `arguments`: ``DeclNameArgumentsSyntax``? public struct DeclNameSyntax: SyntaxProtocol, SyntaxHashable { public let _syntaxNode: Syntax @@ -6377,34 +6377,34 @@ public struct DeclNameSyntax: SyntaxProtocol, SyntaxHashable { /// - Parameters: /// - leadingTrivia: Trivia to be prepended to the leading trivia of the node’s first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored. - /// - declBaseName: The base name of the protocol's requirement. - /// - declNameArguments: The argument labels of the protocol's requirement if it is a function requirement. + /// - baseName: The base name of the protocol's requirement. + /// - arguments: The argument labels of the protocol's requirement if it is a function requirement. /// - trailingTrivia: Trivia to be appended to the trailing trivia of the node’s last token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored. public init( leadingTrivia: Trivia? = nil, - _ unexpectedBeforeDeclBaseName: UnexpectedNodesSyntax? = nil, - declBaseName: TokenSyntax, - _ unexpectedBetweenDeclBaseNameAndDeclNameArguments: UnexpectedNodesSyntax? = nil, - declNameArguments: DeclNameArgumentsSyntax? = nil, - _ unexpectedAfterDeclNameArguments: UnexpectedNodesSyntax? = nil, + _ unexpectedBeforeBaseName: UnexpectedNodesSyntax? = nil, + baseName: TokenSyntax, + _ unexpectedBetweenBaseNameAndArguments: UnexpectedNodesSyntax? = nil, + arguments: DeclNameArgumentsSyntax? = nil, + _ unexpectedAfterArguments: UnexpectedNodesSyntax? = nil, trailingTrivia: Trivia? = nil ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. let data: SyntaxData = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeDeclBaseName, - declBaseName, - unexpectedBetweenDeclBaseNameAndDeclNameArguments, - declNameArguments, - unexpectedAfterDeclNameArguments + unexpectedBeforeBaseName, + baseName, + unexpectedBetweenBaseNameAndArguments, + arguments, + unexpectedAfterArguments ))) { (arena, _) in let layout: [RawSyntax?] = [ - unexpectedBeforeDeclBaseName?.raw, - declBaseName.raw, - unexpectedBetweenDeclBaseNameAndDeclNameArguments?.raw, - declNameArguments?.raw, - unexpectedAfterDeclNameArguments?.raw + unexpectedBeforeBaseName?.raw, + baseName.raw, + unexpectedBetweenBaseNameAndArguments?.raw, + arguments?.raw, + unexpectedAfterArguments?.raw ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.declName, @@ -6419,7 +6419,7 @@ public struct DeclNameSyntax: SyntaxProtocol, SyntaxHashable { self.init(data) } - public var unexpectedBeforeDeclBaseName: UnexpectedNodesSyntax? { + public var unexpectedBeforeBaseName: UnexpectedNodesSyntax? { get { return data.child(at: 0, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -6429,7 +6429,7 @@ public struct DeclNameSyntax: SyntaxProtocol, SyntaxHashable { } /// The base name of the protocol's requirement. - public var declBaseName: TokenSyntax { + public var baseName: TokenSyntax { get { return TokenSyntax(data.child(at: 1, parent: Syntax(self))!) } @@ -6438,7 +6438,7 @@ public struct DeclNameSyntax: SyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenDeclBaseNameAndDeclNameArguments: UnexpectedNodesSyntax? { + public var unexpectedBetweenBaseNameAndArguments: UnexpectedNodesSyntax? { get { return data.child(at: 2, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -6448,7 +6448,7 @@ public struct DeclNameSyntax: SyntaxProtocol, SyntaxHashable { } /// The argument labels of the protocol's requirement if it is a function requirement. - public var declNameArguments: DeclNameArgumentsSyntax? { + public var arguments: DeclNameArgumentsSyntax? { get { return data.child(at: 3, parent: Syntax(self)).map(DeclNameArgumentsSyntax.init) } @@ -6457,7 +6457,7 @@ public struct DeclNameSyntax: SyntaxProtocol, SyntaxHashable { } } - public var unexpectedAfterDeclNameArguments: UnexpectedNodesSyntax? { + public var unexpectedAfterArguments: UnexpectedNodesSyntax? { get { return data.child(at: 4, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -6468,11 +6468,11 @@ public struct DeclNameSyntax: SyntaxProtocol, SyntaxHashable { public static var structure: SyntaxNodeStructure { return .layout([ - \Self.unexpectedBeforeDeclBaseName, - \Self.declBaseName, - \Self.unexpectedBetweenDeclBaseNameAndDeclNameArguments, - \Self.declNameArguments, - \Self.unexpectedAfterDeclNameArguments + \Self.unexpectedBeforeBaseName, + \Self.baseName, + \Self.unexpectedBetweenBaseNameAndArguments, + \Self.arguments, + \Self.unexpectedAfterArguments ]) } } @@ -7641,7 +7641,7 @@ public struct DifferentiabilityParamsSyntax: SyntaxProtocol, SyntaxHashable { /// - `kindSpecifierComma`: `','`? /// - `parameters`: ``DifferentiabilityParamsClauseSyntax``? /// - `parametersComma`: `','`? -/// - `whereClause`: ``GenericWhereClauseSyntax``? +/// - `genericWhereClause`: ``GenericWhereClauseSyntax``? public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHashable { public let _syntaxNode: Syntax @@ -7675,9 +7675,9 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash parameters: DifferentiabilityParamsClauseSyntax? = nil, _ unexpectedBetweenParametersAndParametersComma: UnexpectedNodesSyntax? = nil, parametersComma: TokenSyntax? = nil, - _ unexpectedBetweenParametersCommaAndWhereClause: UnexpectedNodesSyntax? = nil, - whereClause: GenericWhereClauseSyntax? = nil, - _ unexpectedAfterWhereClause: UnexpectedNodesSyntax? = nil, + _ unexpectedBetweenParametersCommaAndGenericWhereClause: UnexpectedNodesSyntax? = nil, + genericWhereClause: GenericWhereClauseSyntax? = nil, + _ unexpectedAfterGenericWhereClause: UnexpectedNodesSyntax? = nil, trailingTrivia: Trivia? = nil ) { @@ -7692,9 +7692,9 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash parameters, unexpectedBetweenParametersAndParametersComma, parametersComma, - unexpectedBetweenParametersCommaAndWhereClause, - whereClause, - unexpectedAfterWhereClause + unexpectedBetweenParametersCommaAndGenericWhereClause, + genericWhereClause, + unexpectedAfterGenericWhereClause ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeKindSpecifier?.raw, @@ -7705,9 +7705,9 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash parameters?.raw, unexpectedBetweenParametersAndParametersComma?.raw, parametersComma?.raw, - unexpectedBetweenParametersCommaAndWhereClause?.raw, - whereClause?.raw, - unexpectedAfterWhereClause?.raw + unexpectedBetweenParametersCommaAndGenericWhereClause?.raw, + genericWhereClause?.raw, + unexpectedAfterGenericWhereClause?.raw ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.differentiableAttributeArguments, @@ -7796,7 +7796,7 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash } } - public var unexpectedBetweenParametersCommaAndWhereClause: UnexpectedNodesSyntax? { + public var unexpectedBetweenParametersCommaAndGenericWhereClause: UnexpectedNodesSyntax? { get { return data.child(at: 8, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -7805,7 +7805,7 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash } } - public var whereClause: GenericWhereClauseSyntax? { + public var genericWhereClause: GenericWhereClauseSyntax? { get { return data.child(at: 9, parent: Syntax(self)).map(GenericWhereClauseSyntax.init) } @@ -7814,7 +7814,7 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash } } - public var unexpectedAfterWhereClause: UnexpectedNodesSyntax? { + public var unexpectedAfterGenericWhereClause: UnexpectedNodesSyntax? { get { return data.child(at: 10, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -7833,9 +7833,9 @@ public struct DifferentiableAttributeArgumentsSyntax: SyntaxProtocol, SyntaxHash \Self.parameters, \Self.unexpectedBetweenParametersAndParametersComma, \Self.parametersComma, - \Self.unexpectedBetweenParametersCommaAndWhereClause, - \Self.whereClause, - \Self.unexpectedAfterWhereClause + \Self.unexpectedBetweenParametersCommaAndGenericWhereClause, + \Self.genericWhereClause, + \Self.unexpectedAfterGenericWhereClause ]) } } @@ -9742,9 +9742,9 @@ public struct FunctionParameterSyntax: SyntaxProtocol, SyntaxHashable { /// ### Children /// -/// - `input`: ``ParameterClauseSyntax`` +/// - `parameterClause`: ``ParameterClauseSyntax`` /// - `effectSpecifiers`: ``FunctionEffectSpecifiersSyntax``? -/// - `output`: ``ReturnClauseSyntax``? +/// - `returnClause`: ``ReturnClauseSyntax``? public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable { public let _syntaxNode: Syntax @@ -9768,35 +9768,35 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable { /// - trailingTrivia: Trivia to be appended to the trailing trivia of the node’s last token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored. public init( leadingTrivia: Trivia? = nil, - _ unexpectedBeforeInput: UnexpectedNodesSyntax? = nil, - input: ParameterClauseSyntax, - _ unexpectedBetweenInputAndEffectSpecifiers: UnexpectedNodesSyntax? = nil, + _ unexpectedBeforeParameterClause: UnexpectedNodesSyntax? = nil, + parameterClause: ParameterClauseSyntax, + _ unexpectedBetweenParameterClauseAndEffectSpecifiers: UnexpectedNodesSyntax? = nil, effectSpecifiers: FunctionEffectSpecifiersSyntax? = nil, - _ unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? = nil, - output: ReturnClauseSyntax? = nil, - _ unexpectedAfterOutput: UnexpectedNodesSyntax? = nil, + _ unexpectedBetweenEffectSpecifiersAndReturnClause: UnexpectedNodesSyntax? = nil, + returnClause: ReturnClauseSyntax? = nil, + _ unexpectedAfterReturnClause: UnexpectedNodesSyntax? = nil, trailingTrivia: Trivia? = nil ) { // Extend the lifetime of all parameters so their arenas don't get destroyed // before they can be added as children of the new arena. let data: SyntaxData = withExtendedLifetime((SyntaxArena(), ( - unexpectedBeforeInput, - input, - unexpectedBetweenInputAndEffectSpecifiers, + unexpectedBeforeParameterClause, + parameterClause, + unexpectedBetweenParameterClauseAndEffectSpecifiers, effectSpecifiers, - unexpectedBetweenEffectSpecifiersAndOutput, - output, - unexpectedAfterOutput + unexpectedBetweenEffectSpecifiersAndReturnClause, + returnClause, + unexpectedAfterReturnClause ))) { (arena, _) in let layout: [RawSyntax?] = [ - unexpectedBeforeInput?.raw, - input.raw, - unexpectedBetweenInputAndEffectSpecifiers?.raw, + unexpectedBeforeParameterClause?.raw, + parameterClause.raw, + unexpectedBetweenParameterClauseAndEffectSpecifiers?.raw, effectSpecifiers?.raw, - unexpectedBetweenEffectSpecifiersAndOutput?.raw, - output?.raw, - unexpectedAfterOutput?.raw + unexpectedBetweenEffectSpecifiersAndReturnClause?.raw, + returnClause?.raw, + unexpectedAfterReturnClause?.raw ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.functionSignature, @@ -9811,7 +9811,7 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable { self.init(data) } - public var unexpectedBeforeInput: UnexpectedNodesSyntax? { + public var unexpectedBeforeParameterClause: UnexpectedNodesSyntax? { get { return data.child(at: 0, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -9820,7 +9820,7 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var input: ParameterClauseSyntax { + public var parameterClause: ParameterClauseSyntax { get { return ParameterClauseSyntax(data.child(at: 1, parent: Syntax(self))!) } @@ -9829,7 +9829,7 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenInputAndEffectSpecifiers: UnexpectedNodesSyntax? { + public var unexpectedBetweenParameterClauseAndEffectSpecifiers: UnexpectedNodesSyntax? { get { return data.child(at: 2, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -9847,7 +9847,7 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? { + public var unexpectedBetweenEffectSpecifiersAndReturnClause: UnexpectedNodesSyntax? { get { return data.child(at: 4, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -9856,7 +9856,7 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var output: ReturnClauseSyntax? { + public var returnClause: ReturnClauseSyntax? { get { return data.child(at: 5, parent: Syntax(self)).map(ReturnClauseSyntax.init) } @@ -9865,7 +9865,7 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable { } } - public var unexpectedAfterOutput: UnexpectedNodesSyntax? { + public var unexpectedAfterReturnClause: UnexpectedNodesSyntax? { get { return data.child(at: 6, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -9876,13 +9876,13 @@ public struct FunctionSignatureSyntax: SyntaxProtocol, SyntaxHashable { public static var structure: SyntaxNodeStructure { return .layout([ - \Self.unexpectedBeforeInput, - \Self.input, - \Self.unexpectedBetweenInputAndEffectSpecifiers, + \Self.unexpectedBeforeParameterClause, + \Self.parameterClause, + \Self.unexpectedBetweenParameterClauseAndEffectSpecifiers, \Self.effectSpecifiers, - \Self.unexpectedBetweenEffectSpecifiersAndOutput, - \Self.output, - \Self.unexpectedAfterOutput + \Self.unexpectedBetweenEffectSpecifiersAndReturnClause, + \Self.returnClause, + \Self.unexpectedAfterReturnClause ]) } } diff --git a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxTypeNodes.swift b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxTypeNodes.swift index 18912f6f08b..98ee65ebf33 100644 --- a/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxTypeNodes.swift +++ b/Sources/SwiftSyntax/generated/syntaxNodes/SyntaxTypeNodes.swift @@ -871,7 +871,7 @@ public struct DictionaryTypeSyntax: TypeSyntaxProtocol, SyntaxHashable { /// - `parameters`: ``TupleTypeElementListSyntax`` /// - `rightParen`: `')'` /// - `effectSpecifiers`: ``TypeEffectSpecifiersSyntax``? -/// - `output`: ``ReturnClauseSyntax`` +/// - `returnClause`: ``ReturnClauseSyntax`` public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable { public let _syntaxNode: Syntax @@ -903,9 +903,9 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable { rightParen: TokenSyntax = .rightParenToken(), _ unexpectedBetweenRightParenAndEffectSpecifiers: UnexpectedNodesSyntax? = nil, effectSpecifiers: TypeEffectSpecifiersSyntax? = nil, - _ unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? = nil, - output: ReturnClauseSyntax, - _ unexpectedAfterOutput: UnexpectedNodesSyntax? = nil, + _ unexpectedBetweenEffectSpecifiersAndReturnClause: UnexpectedNodesSyntax? = nil, + returnClause: ReturnClauseSyntax, + _ unexpectedAfterReturnClause: UnexpectedNodesSyntax? = nil, trailingTrivia: Trivia? = nil ) { @@ -920,9 +920,9 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable { rightParen, unexpectedBetweenRightParenAndEffectSpecifiers, effectSpecifiers, - unexpectedBetweenEffectSpecifiersAndOutput, - output, - unexpectedAfterOutput + unexpectedBetweenEffectSpecifiersAndReturnClause, + returnClause, + unexpectedAfterReturnClause ))) { (arena, _) in let layout: [RawSyntax?] = [ unexpectedBeforeLeftParen?.raw, @@ -933,9 +933,9 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable { rightParen.raw, unexpectedBetweenRightParenAndEffectSpecifiers?.raw, effectSpecifiers?.raw, - unexpectedBetweenEffectSpecifiersAndOutput?.raw, - output.raw, - unexpectedAfterOutput?.raw + unexpectedBetweenEffectSpecifiersAndReturnClause?.raw, + returnClause.raw, + unexpectedAfterReturnClause?.raw ] let raw = RawSyntax.makeLayout( kind: SyntaxKind.functionType, @@ -1046,7 +1046,7 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable { } } - public var unexpectedBetweenEffectSpecifiersAndOutput: UnexpectedNodesSyntax? { + public var unexpectedBetweenEffectSpecifiersAndReturnClause: UnexpectedNodesSyntax? { get { return data.child(at: 8, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -1055,7 +1055,7 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable { } } - public var output: ReturnClauseSyntax { + public var returnClause: ReturnClauseSyntax { get { return ReturnClauseSyntax(data.child(at: 9, parent: Syntax(self))!) } @@ -1064,7 +1064,7 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable { } } - public var unexpectedAfterOutput: UnexpectedNodesSyntax? { + public var unexpectedAfterReturnClause: UnexpectedNodesSyntax? { get { return data.child(at: 10, parent: Syntax(self)).map(UnexpectedNodesSyntax.init) } @@ -1083,9 +1083,9 @@ public struct FunctionTypeSyntax: TypeSyntaxProtocol, SyntaxHashable { \Self.rightParen, \Self.unexpectedBetweenRightParenAndEffectSpecifiers, \Self.effectSpecifiers, - \Self.unexpectedBetweenEffectSpecifiersAndOutput, - \Self.output, - \Self.unexpectedAfterOutput + \Self.unexpectedBetweenEffectSpecifiersAndReturnClause, + \Self.returnClause, + \Self.unexpectedAfterReturnClause ]) } } diff --git a/Sources/SwiftSyntaxBuilder/generated/BuildableNodes.swift b/Sources/SwiftSyntaxBuilder/generated/BuildableNodes.swift index 10aec45f1b2..62ec6fe65c1 100644 --- a/Sources/SwiftSyntaxBuilder/generated/BuildableNodes.swift +++ b/Sources/SwiftSyntaxBuilder/generated/BuildableNodes.swift @@ -975,9 +975,9 @@ extension MacroExpansionDeclSyntax { pound: TokenSyntax = .poundToken(), unexpectedBetweenPoundAndMacro: UnexpectedNodesSyntax? = nil, macro: TokenSyntax, - unexpectedBetweenMacroAndGenericArguments: UnexpectedNodesSyntax? = nil, - genericArguments: GenericArgumentClauseSyntax? = nil, - unexpectedBetweenGenericArgumentsAndLeftParen: UnexpectedNodesSyntax? = nil, + unexpectedBetweenMacroAndGenericArgumentClause: UnexpectedNodesSyntax? = nil, + genericArgumentClause: GenericArgumentClauseSyntax? = nil, + unexpectedBetweenGenericArgumentClauseAndLeftParen: UnexpectedNodesSyntax? = nil, leftParen: TokenSyntax? = nil, unexpectedBetweenLeftParenAndArgumentList: UnexpectedNodesSyntax? = nil, unexpectedBetweenArgumentListAndRightParen: UnexpectedNodesSyntax? = nil, @@ -1000,9 +1000,9 @@ extension MacroExpansionDeclSyntax { pound: pound, unexpectedBetweenPoundAndMacro, macro: macro, - unexpectedBetweenMacroAndGenericArguments, - genericArguments: genericArguments, - unexpectedBetweenGenericArgumentsAndLeftParen, + unexpectedBetweenMacroAndGenericArgumentClause, + genericArgumentClause: genericArgumentClause, + unexpectedBetweenGenericArgumentClauseAndLeftParen, leftParen: leftParen, unexpectedBetweenLeftParenAndArgumentList, argumentList: argumentListBuilder(), @@ -1026,9 +1026,9 @@ extension MacroExpansionExprSyntax { pound: TokenSyntax = .poundToken(), unexpectedBetweenPoundAndMacro: UnexpectedNodesSyntax? = nil, macro: TokenSyntax, - unexpectedBetweenMacroAndGenericArguments: UnexpectedNodesSyntax? = nil, - genericArguments: GenericArgumentClauseSyntax? = nil, - unexpectedBetweenGenericArgumentsAndLeftParen: UnexpectedNodesSyntax? = nil, + unexpectedBetweenMacroAndGenericArgumentClause: UnexpectedNodesSyntax? = nil, + genericArgumentClause: GenericArgumentClauseSyntax? = nil, + unexpectedBetweenGenericArgumentClauseAndLeftParen: UnexpectedNodesSyntax? = nil, leftParen: TokenSyntax? = nil, unexpectedBetweenLeftParenAndArgumentList: UnexpectedNodesSyntax? = nil, unexpectedBetweenArgumentListAndRightParen: UnexpectedNodesSyntax? = nil, @@ -1047,9 +1047,9 @@ extension MacroExpansionExprSyntax { pound: pound, unexpectedBetweenPoundAndMacro, macro: macro, - unexpectedBetweenMacroAndGenericArguments, - genericArguments: genericArguments, - unexpectedBetweenGenericArgumentsAndLeftParen, + unexpectedBetweenMacroAndGenericArgumentClause, + genericArgumentClause: genericArgumentClause, + unexpectedBetweenGenericArgumentClauseAndLeftParen, leftParen: leftParen, unexpectedBetweenLeftParenAndArgumentList, argumentList: argumentListBuilder(), diff --git a/Sources/SwiftSyntaxBuilder/generated/RenamedChildrenBuilderCompatibility.swift b/Sources/SwiftSyntaxBuilder/generated/RenamedChildrenBuilderCompatibility.swift index f25c51dc1f0..16c31f2d2cd 100644 --- a/Sources/SwiftSyntaxBuilder/generated/RenamedChildrenBuilderCompatibility.swift +++ b/Sources/SwiftSyntaxBuilder/generated/RenamedChildrenBuilderCompatibility.swift @@ -15,7 +15,7 @@ import SwiftSyntax extension AccessorDeclSyntax { - @available(*, deprecated, message: "Use an initializer with accessorKind argument(s).") + @available(*, deprecated, message: "Use an initializer with accessorSpecifier argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -62,7 +62,7 @@ extension AccessorDeclSyntax { } extension ArrayExprSyntax { - @available(*, deprecated, message: "Use an initializer with leftSquareBracket, rightSquareBracket argument(s).") + @available(*, deprecated, message: "Use an initializer with leftSquare, rightSquare argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -91,7 +91,7 @@ extension ArrayExprSyntax { } extension EnumDeclSyntax { - @available(*, deprecated, message: "Use an initializer with genericParameters argument(s).") + @available(*, deprecated, message: "Use an initializer with genericParameterClause argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -140,7 +140,7 @@ extension EnumDeclSyntax { } extension ExpressionSegmentSyntax { - @available(*, deprecated, message: "Use an initializer with delimiter argument(s).") + @available(*, deprecated, message: "Use an initializer with rawStringDelimiter argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -177,7 +177,7 @@ extension ExpressionSegmentSyntax { } extension GenericArgumentClauseSyntax { - @available(*, deprecated, message: "Use an initializer with leftAngleBracket, rightAngleBracket argument(s).") + @available(*, deprecated, message: "Use an initializer with leftAngle, rightAngle argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -206,7 +206,7 @@ extension GenericArgumentClauseSyntax { } extension GenericParameterClauseSyntax { - @available(*, deprecated, message: "Use an initializer with leftAngleBracket, genericParameterList, rightAngleBracket argument(s).") + @available(*, deprecated, message: "Use an initializer with leftAngle, parameters, rightAngle argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -239,7 +239,7 @@ extension GenericParameterClauseSyntax { } extension KeyPathSubscriptComponentSyntax { - @available(*, deprecated, message: "Use an initializer with leftBracket, rightBracket argument(s).") + @available(*, deprecated, message: "Use an initializer with leftSquare, rightSquare argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -268,7 +268,7 @@ extension KeyPathSubscriptComponentSyntax { } extension MacroExpansionDeclSyntax { - @available(*, deprecated, message: "Use an initializer with poundToken argument(s).") + @available(*, deprecated, message: "Use an initializer with pound, genericArgumentClause argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -307,7 +307,7 @@ extension MacroExpansionDeclSyntax { unexpectedBetweenPoundTokenAndMacro, macro: macro, unexpectedBetweenMacroAndGenericArguments, - genericArguments: genericArguments, + genericArgumentClause: genericArguments, unexpectedBetweenGenericArgumentsAndLeftParen, leftParen: leftParen, unexpectedBetweenLeftParenAndArgumentList, @@ -325,7 +325,7 @@ extension MacroExpansionDeclSyntax { } extension MacroExpansionExprSyntax { - @available(*, deprecated, message: "Use an initializer with poundToken argument(s).") + @available(*, deprecated, message: "Use an initializer with pound, genericArgumentClause argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -356,7 +356,7 @@ extension MacroExpansionExprSyntax { unexpectedBetweenPoundTokenAndMacro, macro: macro, unexpectedBetweenMacroAndGenericArguments, - genericArguments: genericArguments, + genericArgumentClause: genericArguments, unexpectedBetweenGenericArgumentsAndLeftParen, leftParen: leftParen, unexpectedBetweenLeftParenAndArgumentList, @@ -374,7 +374,7 @@ extension MacroExpansionExprSyntax { } extension SourceFileSyntax { - @available(*, deprecated, message: "Use an initializer with eOFToken argument(s).") + @available(*, deprecated, message: "Use an initializer with endOfFileToken argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -399,7 +399,7 @@ extension SourceFileSyntax { } extension SubscriptExprSyntax { - @available(*, deprecated, message: "Use an initializer with leftBracket, rightBracket argument(s).") + @available(*, deprecated, message: "Use an initializer with leftSquare, rightSquare argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -440,7 +440,7 @@ extension SubscriptExprSyntax { } extension TupleExprSyntax { - @available(*, deprecated, message: "Use an initializer with elementList argument(s).") + @available(*, deprecated, message: "Use an initializer with elements argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( @@ -469,7 +469,7 @@ extension TupleExprSyntax { } extension VariableDeclSyntax { - @available(*, deprecated, message: "Use an initializer with bindingKeyword argument(s).") + @available(*, deprecated, message: "Use an initializer with bindingSpecifier argument(s).") @_disfavoredOverload /// A convenience initializer that allows initializing syntax collections using result builders public init( diff --git a/Sources/SwiftSyntaxMacroExpansion/MacroReplacement.swift b/Sources/SwiftSyntaxMacroExpansion/MacroReplacement.swift index 09a62b718d1..696d1ad4f03 100644 --- a/Sources/SwiftSyntaxMacroExpansion/MacroReplacement.swift +++ b/Sources/SwiftSyntaxMacroExpansion/MacroReplacement.swift @@ -116,7 +116,7 @@ fileprivate class ParameterReplacementVisitor: SyntaxAnyVisitor { let identifier = node.identifier let signature = macro.signature - let matchedParameter = signature.input.parameterList.enumerated().first { (index, parameter) in + let matchedParameter = signature.parameterClause.parameterList.enumerated().first { (index, parameter) in if identifier.text == "_" { return false } diff --git a/Tests/SwiftParserTest/DeclarationTests.swift b/Tests/SwiftParserTest/DeclarationTests.swift index b6ec62ba2c7..db3dee4c663 100644 --- a/Tests/SwiftParserTest/DeclarationTests.swift +++ b/Tests/SwiftParserTest/DeclarationTests.swift @@ -812,7 +812,7 @@ final class DeclarationTests: XCTestCase { funcKeyword: .keyword(.func), identifier: .identifier("withoutParameters"), signature: FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( leftParen: .leftParenToken(presence: .missing), parameterList: FunctionParameterListSyntax([]), rightParen: .rightParenToken(presence: .missing) @@ -2072,7 +2072,7 @@ final class DeclarationTests: XCTestCase { funcKeyword: .keyword(.func, presence: .missing), identifier: .binaryOperator("^"), signature: FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( leftParen: .leftParenToken(presence: .missing), parameterList: FunctionParameterListSyntax([]), rightParen: .rightParenToken(presence: .missing) @@ -2442,7 +2442,7 @@ final class DeclarationTests: XCTestCase { withoutTilde: .prefixOperator("~"), patternType: FunctionTypeSyntax( parameters: [TupleTypeElementSyntax(type: TypeSyntax("Int"))], - output: ReturnClauseSyntax(returnType: TypeSyntax("Bool")) + returnClause: ReturnClauseSyntax(returnType: TypeSyntax("Bool")) ) ) ) @@ -2572,7 +2572,7 @@ final class DeclarationTests: XCTestCase { InitializerDeclSyntax( initKeyword: .keyword(.`init`), signature: FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( leftParen: .leftParenToken(), parameterList: FunctionParameterListSyntax([ FunctionParameterSyntax( diff --git a/Tests/SwiftParserTest/SyntaxTransformVisitorTest.swift b/Tests/SwiftParserTest/SyntaxTransformVisitorTest.swift index b12542f405f..4d48278c51c 100644 --- a/Tests/SwiftParserTest/SyntaxTransformVisitorTest.swift +++ b/Tests/SwiftParserTest/SyntaxTransformVisitorTest.swift @@ -60,12 +60,12 @@ final class SyntaxTransformVisitorTest: XCTestCase { } public func visit(_ node: FunctionDeclSyntax) -> String { - let argStrings = node.signature.input.parameterList + let argStrings = node.signature.parameterClause.parameterList .compactMap { $0.type } .compactMap(visit) let resultString: String - if let out = node.signature.output { + if let out = node.signature.returnClause { resultString = visit(out.returnType) } else { resultString = "Void" diff --git a/Tests/SwiftSyntaxBuilderTest/ClosureExprTests.swift b/Tests/SwiftSyntaxBuilderTest/ClosureExprTests.swift index e9df80190dd..7c02783fd2d 100644 --- a/Tests/SwiftSyntaxBuilderTest/ClosureExprTests.swift +++ b/Tests/SwiftSyntaxBuilderTest/ClosureExprTests.swift @@ -18,7 +18,7 @@ final class ClosureExprTests: XCTestCase { func testClosureExpr() { let buildable = ClosureExprSyntax( signature: ClosureSignatureSyntax( - input: .simpleInput( + parameterClause: .simpleInput( ClosureParamListSyntax { ClosureParamSyntax(name: .identifier("area")) } @@ -37,7 +37,7 @@ final class ClosureExprTests: XCTestCase { func testClosureExprWithAsync() { let buildable = ClosureExprSyntax( signature: ClosureSignatureSyntax( - input: .simpleInput( + parameterClause: .simpleInput( ClosureParamListSyntax { ClosureParamSyntax(name: .identifier("area")) } diff --git a/Tests/SwiftSyntaxBuilderTest/FunctionSignatureSyntaxTests.swift b/Tests/SwiftSyntaxBuilderTest/FunctionSignatureSyntaxTests.swift index cc86abdb0c4..26bb56555f1 100644 --- a/Tests/SwiftSyntaxBuilderTest/FunctionSignatureSyntaxTests.swift +++ b/Tests/SwiftSyntaxBuilderTest/FunctionSignatureSyntaxTests.swift @@ -17,7 +17,11 @@ import SwiftSyntaxBuilder final class FunctionSignatureSyntaxTests: XCTestCase { func testFunctionEffectSpecifiersSyntax() throws { let functionEffects = FunctionEffectSpecifiersSyntax(asyncSpecifier: .keyword(.async), throwsSpecifier: .keyword(.rethrows)) - let buildable = FunctionSignatureSyntax(input: .init(parameterList: []), effectSpecifiers: functionEffects, output: .init(returnType: TypeSyntax("String"))) + let buildable = FunctionSignatureSyntax( + parameterClause: .init(parameterList: []), + effectSpecifiers: functionEffects, + returnClause: .init(returnType: TypeSyntax("String")) + ) assertBuildResult( buildable, diff --git a/Tests/SwiftSyntaxBuilderTest/FunctionTests.swift b/Tests/SwiftSyntaxBuilderTest/FunctionTests.swift index b08bec76cb5..0969cb5c392 100644 --- a/Tests/SwiftSyntaxBuilderTest/FunctionTests.swift +++ b/Tests/SwiftSyntaxBuilderTest/FunctionTests.swift @@ -186,10 +186,10 @@ final class FunctionTests: XCTestCase { modifiers: [DeclModifierSyntax(name: .keyword(.public))], identifier: TokenSyntax.identifier("foo"), signature: FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( parameterList: FunctionParameterListSyntax {} ), - output: ReturnClauseSyntax( + returnClause: ReturnClauseSyntax( returnType: SimpleTypeIdentifierSyntax(name: .identifier("String")) ) ), @@ -210,13 +210,13 @@ final class FunctionTests: XCTestCase { modifiers: [DeclModifierSyntax(name: .keyword(.public)), DeclModifierSyntax(name: .keyword(.static))], identifier: TokenSyntax.identifier("=="), signature: FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( parameterList: FunctionParameterListSyntax { FunctionParameterSyntax(firstName: TokenSyntax.identifier("lhs"), colon: .colonToken(), type: TypeSyntax("String")) FunctionParameterSyntax(firstName: TokenSyntax.identifier("rhs"), colon: .colonToken(), type: TypeSyntax("String")) } ), - output: ReturnClauseSyntax( + returnClause: ReturnClauseSyntax( returnType: SimpleTypeIdentifierSyntax(name: TokenSyntax.identifier("Bool")) ) ), @@ -245,7 +245,7 @@ final class FunctionTests: XCTestCase { modifiers: [DeclModifierSyntax(name: .keyword(.public)), DeclModifierSyntax(name: .keyword(.static))], identifier: TokenSyntax.identifier("=="), signature: FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( parameterList: FunctionParameterListSyntax { FunctionParameterSyntax(firstName: TokenSyntax.identifier("lhs1"), colon: .colonToken(), type: TypeSyntax("String")) FunctionParameterSyntax(firstName: TokenSyntax.identifier("lhs2"), colon: .colonToken(), type: TypeSyntax("String")) @@ -253,7 +253,7 @@ final class FunctionTests: XCTestCase { FunctionParameterSyntax(firstName: TokenSyntax.identifier("rhs2"), colon: .colonToken(), type: TypeSyntax("String")) } ), - output: ReturnClauseSyntax( + returnClause: ReturnClauseSyntax( returnType: SimpleTypeIdentifierSyntax(name: TokenSyntax.identifier("Bool")) ) ), diff --git a/Tests/SwiftSyntaxBuilderTest/FunctionTypeSyntaxTests.swift b/Tests/SwiftSyntaxBuilderTest/FunctionTypeSyntaxTests.swift index 826262eb5b3..ab55e865540 100644 --- a/Tests/SwiftSyntaxBuilderTest/FunctionTypeSyntaxTests.swift +++ b/Tests/SwiftSyntaxBuilderTest/FunctionTypeSyntaxTests.swift @@ -17,7 +17,11 @@ import SwiftSyntaxBuilder final class FunctionTypeSyntaxTests: XCTestCase { func testFunctionEffectSpecifiersSyntax() throws { let typeEffects = TypeEffectSpecifiersSyntax(asyncSpecifier: .keyword(.async), throwsSpecifier: .keyword(.throws)) - let buildable = FunctionTypeSyntax(parameters: [], effectSpecifiers: typeEffects, output: .init(returnType: TypeSyntax("String"))) + let buildable = FunctionTypeSyntax( + parameters: [], + effectSpecifiers: typeEffects, + returnClause: .init(returnType: TypeSyntax("String")) + ) assertBuildResult( buildable, diff --git a/Tests/SwiftSyntaxBuilderTest/VariableTests.swift b/Tests/SwiftSyntaxBuilderTest/VariableTests.swift index 00e3951c42c..f5bf73a01b3 100644 --- a/Tests/SwiftSyntaxBuilderTest/VariableTests.swift +++ b/Tests/SwiftSyntaxBuilderTest/VariableTests.swift @@ -225,7 +225,10 @@ final class VariableTests: XCTestCase { } func testClosureTypeVariableDecl() { - let type = FunctionTypeSyntax(parameters: [TupleTypeElementSyntax(type: TypeSyntax("Int"))], output: ReturnClauseSyntax(returnType: TypeSyntax("Bool"))) + let type = FunctionTypeSyntax( + parameters: [TupleTypeElementSyntax(type: TypeSyntax("Int"))], + returnClause: ReturnClauseSyntax(returnType: TypeSyntax("Bool")) + ) let buildable = VariableDeclSyntax(bindingSpecifier: .keyword(.let)) { PatternBindingSyntax(pattern: PatternSyntax("c"), typeAnnotation: TypeAnnotationSyntax(type: type)) } diff --git a/Tests/SwiftSyntaxMacroExpansionTest/MacroSystemTests.swift b/Tests/SwiftSyntaxMacroExpansionTest/MacroSystemTests.swift index 96d068e6325..cbfac7c271c 100644 --- a/Tests/SwiftSyntaxMacroExpansionTest/MacroSystemTests.swift +++ b/Tests/SwiftSyntaxMacroExpansionTest/MacroSystemTests.swift @@ -337,7 +337,7 @@ public struct AddCompletionHandler: PeerMacro { } // Form the completion handler parameter. - let resultType: TypeSyntax? = funcDecl.signature.output?.returnType.with(\.leadingTrivia, []).with(\.trailingTrivia, []) + let resultType: TypeSyntax? = funcDecl.signature.returnClause?.returnType.with(\.leadingTrivia, []).with(\.trailingTrivia, []) let completionHandlerParam = FunctionParameterSyntax( @@ -347,7 +347,7 @@ public struct AddCompletionHandler: PeerMacro { ) // Add the completion handler parameter to the parameter list. - let parameterList = funcDecl.signature.input.parameterList + let parameterList = funcDecl.signature.parameterClause.parameterList let newParameterList: FunctionParameterListSyntax if let lastParam = parameterList.last { // We need to add a trailing comma to the preceding list. @@ -411,10 +411,10 @@ public struct AddCompletionHandler: PeerMacro { \.effectSpecifiers, funcDecl.signature.effectSpecifiers?.with(\.asyncSpecifier, nil) // drop async ) - .with(\.output, nil) // drop result type + .with(\.returnClause, nil) // drop result type .with( - \.input, // add completion handler parameter - funcDecl.signature.input.with(\.parameterList, newParameterList) + \.parameterClause, // add completion handler parameter + funcDecl.signature.parameterClause.with(\.parameterList, newParameterList) .with(\.trailingTrivia, []) ) ) diff --git a/Tests/SwiftSyntaxTest/SyntaxTests.swift b/Tests/SwiftSyntaxTest/SyntaxTests.swift index 207394745fc..c0c0133103c 100644 --- a/Tests/SwiftSyntaxTest/SyntaxTests.swift +++ b/Tests/SwiftSyntaxTest/SyntaxTests.swift @@ -26,14 +26,14 @@ public class SyntaxTests: XCTestCase { FunctionDeclSyntax( funcKeyword: TokenSyntax.keyword(.func, presence: .missing), identifier: .identifier("foo"), - signature: FunctionSignatureSyntax(input: ParameterClauseSyntax(parameterList: [])) + signature: FunctionSignatureSyntax(parameterClause: ParameterClauseSyntax(parameterList: [])) ).hasError ) XCTAssertFalse( FunctionDeclSyntax( funcKeyword: TokenSyntax.keyword(.func, presence: .present), identifier: .identifier("foo"), - signature: FunctionSignatureSyntax(input: ParameterClauseSyntax(parameterList: [])) + signature: FunctionSignatureSyntax(parameterClause: ParameterClauseSyntax(parameterList: [])) ).hasError ) } diff --git a/Tests/SwiftSyntaxTest/SyntaxVisitorTests.swift b/Tests/SwiftSyntaxTest/SyntaxVisitorTests.swift index 755da97b886..b5b33e43873 100644 --- a/Tests/SwiftSyntaxTest/SyntaxVisitorTests.swift +++ b/Tests/SwiftSyntaxTest/SyntaxVisitorTests.swift @@ -58,7 +58,7 @@ public class SyntaxVisitorTests: XCTestCase { funcKeyword: .keyword(.func, trailingTrivia: .space), identifier: .identifier("foo"), signature: FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( leftParen: .leftParenToken(), parameterList: FunctionParameterListSyntax([]), rightParen: .rightParenToken(trailingTrivia: .space) @@ -76,7 +76,7 @@ public class SyntaxVisitorTests: XCTestCase { funcKeyword: .keyword(.func, trailingTrivia: .space), identifier: .identifier("foo"), signature: FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( leftParen: .leftParenToken(), parameterList: FunctionParameterListSyntax([]), rightParen: .rightParenToken(trailingTrivia: .space) @@ -91,7 +91,7 @@ public class SyntaxVisitorTests: XCTestCase { funcKeyword: .keyword(.func, leadingTrivia: [.newlines(1), .spaces(4)], trailingTrivia: .space), identifier: .identifier("foo"), signature: FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( leftParen: .leftParenToken(), parameterList: FunctionParameterListSyntax([]), rightParen: .rightParenToken(trailingTrivia: .space) diff --git a/Tests/SwiftSyntaxTestSupportTest/SyntaxComparisonTests.swift b/Tests/SwiftSyntaxTestSupportTest/SyntaxComparisonTests.swift index bbe10ecdae0..d459304de2b 100644 --- a/Tests/SwiftSyntaxTestSupportTest/SyntaxComparisonTests.swift +++ b/Tests/SwiftSyntaxTestSupportTest/SyntaxComparisonTests.swift @@ -193,7 +193,7 @@ public class SyntaxComparisonTests: XCTestCase { funcBody = makeBody() } let emptySignature = FunctionSignatureSyntax( - input: ParameterClauseSyntax( + parameterClause: ParameterClauseSyntax( leftParen: .leftParenToken(), parameterList: FunctionParameterListSyntax([]), rightParen: .rightParenToken()