Skip to content

Commit dea0d25

Browse files
author
David Brunow
committed
Fix build issues after bringing in the latest from main
1 parent 3172157 commit dea0d25

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,9 +1333,10 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
13331333
if isNestedInPostfixIfConfig(node: Syntax(node)) {
13341334
let breakToken: Token
13351335
let currentIfConfigDecl = node.parent?.parent?.as(IfConfigDeclSyntax.self)
1336-
let tokenBeforeCurrentIfConfigDecl = currentIfConfigDecl?.previousToken
13371336

1338-
if isNestedInIfConfig(Syntax(tokenBeforeCurrentIfConfigDecl)) ||
1337+
if let currentIfConfigDecl = currentIfConfigDecl,
1338+
let tokenBeforeCurrentIfConfigDecl = currentIfConfigDecl?.previousToken,
1339+
isNestedInIfConfig(node: Syntax(tokenBeforeCurrentIfConfigDecl)) ||
13391340
tokenBeforeCurrentIfConfigDecl?.text == "}" {
13401341
breakToken = .break(.reset)
13411342
} else {

0 commit comments

Comments
 (0)