Skip to content

Commit 89d38e4

Browse files
committed
Update swift-syntax for renamed API
1 parent 8e53ebe commit 89d38e4

File tree

69 files changed

+447
-448
lines changed

Some content is hidden

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

69 files changed

+447
-448
lines changed

CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public let EXPR_NODES: [Node] = [
444444
documentation: "The '(' to open the parameter clause."
445445
),
446446
Child(
447-
name: "Properties",
447+
name: "Parameters",
448448
deprecatedName: "ParameterList",
449449
kind: .collection(kind: .closureParameterList, collectionElementName: "Parameter"),
450450
nameForDiagnostics: "parameters",

Sources/SwiftCompilerPluginMessageHandling/Macros.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ extension CompilerPluginMessageHandler {
107107
}
108108
let conformanceList = conformanceListSyntax.map {
109109
let placeholderStruct = sourceManager.add($0).cast(StructDeclSyntax.self)
110-
return placeholderStruct.inheritanceClause!.inheritedTypeCollection
110+
return placeholderStruct.inheritanceClause!.inheritedTypes
111111
}
112112

113113
// TODO: Make this a 'String?' and remove non-'hasExpandMacroResult' branches.

Sources/SwiftOperators/OperatorTable+Folding.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ extension OperatorTable {
151151
if let ternaryExpr = op.as(UnresolvedTernaryExprSyntax.self) {
152152
return ExprSyntax(
153153
TernaryExprSyntax(
154-
conditionExpression: lhs,
154+
condition: lhs,
155155
ternaryExpr.unexpectedBeforeQuestionMark,
156156
questionMark: ternaryExpr.questionMark,
157157
ternaryExpr.unexpectedBetweenQuestionMarkAndFirstChoice,
@@ -183,7 +183,7 @@ extension OperatorTable {
183183
expression: lhs,
184184
isExpr.unexpectedBeforeIsKeyword,
185185
isKeyword: isExpr.isKeyword,
186-
typeName: rhs.as(TypeExprSyntax.self)!.type
186+
type: rhs.as(TypeExprSyntax.self)!.type
187187
)
188188
)
189189
}
@@ -199,7 +199,7 @@ extension OperatorTable {
199199
asKeyword: asExpr.asKeyword,
200200
asExpr.unexpectedBetweenAsKeywordAndQuestionOrExclamationMark,
201201
questionOrExclamationMark: asExpr.questionOrExclamationMark,
202-
typeName: rhs.as(TypeExprSyntax.self)!.type
202+
type: rhs.as(TypeExprSyntax.self)!.type
203203
)
204204
)
205205
}

Sources/SwiftOperators/OperatorTable+Semantics.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extension PrecedenceGroup {
1616
///
1717
/// TODO: This ignores all semantic errors.
1818
init(from syntax: PrecedenceGroupDeclSyntax) {
19-
self.name = syntax.identifier.text
19+
self.name = syntax.name.text
2020
self.syntax = syntax
2121

2222
for attr in syntax.groupAttributes {
@@ -70,7 +70,7 @@ extension Operator {
7070
self.syntax = syntax
7171
kind = OperatorKind(rawValue: syntax.fixitySpecifier.text) ?? .infix
7272

73-
name = syntax.identifier.text
73+
name = syntax.name.text
7474

7575
precedenceGroup = syntax.operatorPrecedenceAndTypes?.precedenceGroup.text
7676
}

Sources/SwiftOperators/SyntaxSynthesis.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ extension Operator {
2828
public func synthesizedSyntax() -> OperatorDeclSyntax {
2929
let fixitySpecifier = TokenSyntax.keyword(kind.keyword)
3030
let operatorKeyword = TokenSyntax.keyword(.operator, leadingTrivia: .space)
31-
let identifierSyntax =
32-
TokenSyntax.binaryOperator(name, leadingTrivia: .space)
31+
let name = TokenSyntax.binaryOperator(name, leadingTrivia: .space)
3332
let precedenceGroupSyntax = precedenceGroup.map { groupName in
3433
OperatorPrecedenceAndTypesSyntax(
3534
colon: .colonToken(),
@@ -41,7 +40,7 @@ extension Operator {
4140
return OperatorDeclSyntax(
4241
fixitySpecifier: fixitySpecifier,
4342
operatorKeyword: operatorKeyword,
44-
identifier: identifierSyntax,
43+
name: name,
4544
operatorPrecedenceAndTypes: precedenceGroupSyntax
4645
)
4746
}
@@ -146,7 +145,7 @@ extension PrecedenceGroup {
146145

147146
return PrecedenceGroupDeclSyntax(
148147
precedencegroupKeyword: precedencegroupKeyword,
149-
identifier: identifierSyntax,
148+
name: identifierSyntax,
150149
leftBrace: leftBrace,
151150
groupAttributes: PrecedenceGroupAttributeListSyntax(groupAttributes),
152151
rightBrace: rightBrace

Sources/SwiftParser/Attributes.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ extension Parser {
152152
atSign: atSign,
153153
attributeName: attributeName,
154154
leftParen: nil,
155-
argument: nil,
155+
arguments: nil,
156156
rightParen: nil,
157157
arena: self.arena
158158
)
@@ -167,7 +167,7 @@ extension Parser {
167167

168168
mutating func parseAttribute(
169169
argumentMode: AttributeArgumentMode,
170-
parseArguments: (inout Parser) -> RawAttributeSyntax.Argument
170+
parseArguments: (inout Parser) -> RawAttributeSyntax.Arguments
171171
) -> RawAttributeListSyntax.Element {
172172
let (unexpectedBeforeAtSign, atSign) = self.expect(.atSign)
173173
let attributeName = self.parseType()
@@ -191,7 +191,7 @@ extension Parser {
191191
attributeName: attributeName,
192192
unexpectedBeforeLeftParen,
193193
leftParen: leftParen,
194-
argument: argument,
194+
arguments: argument,
195195
unexpectedBeforeRightParen,
196196
rightParen: rightParen,
197197
arena: self.arena
@@ -204,7 +204,7 @@ extension Parser {
204204
atSign: atSign,
205205
attributeName: attributeName,
206206
leftParen: nil,
207-
argument: nil,
207+
arguments: nil,
208208
rightParen: nil,
209209
arena: self.arena
210210
)
@@ -331,7 +331,7 @@ extension Parser {
331331
unexpectedBeforeAttributeName,
332332
attributeName: RawTypeSyntax(RawSimpleTypeIdentifierSyntax(name: attributeName, genericArgumentClause: nil, arena: self.arena)),
333333
leftParen: nil,
334-
argument: nil,
334+
arguments: nil,
335335
rightParen: nil,
336336
arena: self.arena
337337
)
@@ -384,7 +384,7 @@ extension Parser {
384384
attributeName: RawTypeSyntax(RawSimpleTypeIdentifierSyntax(name: differentiable, genericArgumentClause: nil, arena: self.arena)),
385385
unexpectedBeforeLeftParen,
386386
leftParen: leftParen,
387-
argument: .differentiableArguments(argument),
387+
arguments: .differentiableArguments(argument),
388388
unexpectedBeforeRightParen,
389389
rightParen: rightParen,
390390
arena: self.arena
@@ -464,7 +464,7 @@ extension Parser {
464464
let parameters = RawDifferentiabilityParamListSyntax(elements: elements, arena: self.arena)
465465
let list = RawDifferentiabilityParamsSyntax(
466466
leftParen: leftParen,
467-
diffParams: parameters,
467+
differentiabilityParameters: parameters,
468468
unexpectedBeforeRightParen,
469469
rightParen: rightParen,
470470
arena: self.arena
@@ -526,7 +526,7 @@ extension Parser {
526526
attributeName: RawTypeSyntax(RawSimpleTypeIdentifierSyntax(name: derivative, genericArgumentClause: nil, arena: self.arena)),
527527
unexpectedBeforeLeftParen,
528528
leftParen: leftParen,
529-
argument: .derivativeRegistrationArguments(argument),
529+
arguments: .derivativeRegistrationArguments(argument),
530530
unexpectedBeforeRightParen,
531531
rightParen: rightParen,
532532
arena: self.arena
@@ -548,7 +548,7 @@ extension Parser {
548548
attributeName: RawTypeSyntax(RawSimpleTypeIdentifierSyntax(name: transpose, genericArgumentClause: nil, arena: self.arena)),
549549
unexpectedBeforeLeftParen,
550550
leftParen: leftParen,
551-
argument: .derivativeRegistrationArguments(argument),
551+
arguments: .derivativeRegistrationArguments(argument),
552552
unexpectedBeforeRightParen,
553553
rightParen: rightParen,
554554
arena: self.arena
@@ -694,7 +694,7 @@ extension Parser {
694694
targetLabel: ident,
695695
unexpectedBeforeColon,
696696
colon: colon,
697-
declname: declName,
697+
declName: declName,
698698
trailingComma: comma,
699699
arena: self.arena
700700
)
@@ -855,7 +855,7 @@ extension Parser {
855855
}
856856

857857
extension Parser {
858-
mutating func parseConventionArguments() -> RawAttributeSyntax.Argument {
858+
mutating func parseConventionArguments() -> RawAttributeSyntax.Arguments {
859859
if let witnessMethod = self.consume(if: .keyword(.witness_method)) {
860860
let (unexpectedBeforeColon, colon) = self.expect(.colon)
861861
let name = self.parseAnyIdentifier()
@@ -1037,7 +1037,7 @@ extension Parser {
10371037
forLabel: label,
10381038
unexpectedBeforeColon,
10391039
colon: colon,
1040-
declname: method,
1040+
declName: method,
10411041
arena: self.arena
10421042
)
10431043
}

0 commit comments

Comments
 (0)