Skip to content

Commit

Permalink
Merge pull request #574 from ahoppen/ahoppen/rename-differentiability…
Browse files Browse the repository at this point in the history
…-nodes

Rename children of differentiability nodes
  • Loading branch information
ahoppen committed Jul 27, 2023
2 parents b92a7dc + 0cd30c5 commit d16d7de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2532,9 +2532,9 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
// This node encapsulates the entire list of arguments in a `@differentiable(...)` attribute.
var needsBreakBeforeWhereClause = false

if let diffParamsComma = node.parametersComma {
if let diffParamsComma = node.argumentsComma {
after(diffParamsComma, tokens: .break(.same))
} else if node.parameters != nil {
} else if node.arguments != nil {
// If there were diff params but no comma following them, then we have "wrt: foo where ..."
// and we need a break before the where clause.
needsBreakBeforeWhereClause = true
Expand Down Expand Up @@ -2571,7 +2571,7 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
// The comma after originalDeclName is optional and is only present if there are diffParams.
after(node.comma ?? node.originalDeclName.lastToken(viewMode: .sourceAccurate), tokens: .close)

if let diffParams = node.parameters {
if let diffParams = node.arguments {
before(diffParams.firstToken(viewMode: .sourceAccurate), tokens: .break(.same), .open)
after(diffParams.lastToken(viewMode: .sourceAccurate), tokens: .close)
}
Expand Down

0 comments on commit d16d7de

Please sign in to comment.