Skip to content

Commit 84aa2a8

Browse files
committed
Use new TernaryExpr convenience initializer in BuildableNodesFile
1 parent 5736dff commit 84aa2a8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Sources/generate-swift-syntax-builder/Templates/BuildableNodesFile.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,9 @@ private func createWithTrailingCommaFunction(node: Node) -> FunctionDecl {
355355
label: child.swiftName,
356356
expression: child.name == "TrailingComma" ? SequenceExpr {
357357
TernaryExpr(
358-
conditionExpression: "withComma",
359-
questionMark: .infixQuestionMark.withLeadingTrivia(.space).withTrailingTrivia(.space),
360-
firstChoice: MemberAccessExpr(name: "comma"),
361-
colonMark: .colon.withLeadingTrivia(.space).withTrailingTrivia(.space),
362-
secondChoice: NilLiteralExpr()
358+
if: "withComma",
359+
then: MemberAccessExpr(name: "comma"),
360+
else: NilLiteralExpr()
363361
)
364362
} : child.swiftName
365363
)

0 commit comments

Comments
 (0)