Skip to content

Commit 48f514b

Browse files
committed
WIP
1 parent 807698a commit 48f514b

18 files changed

+703
-40910
lines changed

CodeGeneration/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ let package = Package(
2121
// checkout of swift-syntax that is unaffected by the newly generated files.
2222
// Be sure to revert the change before committing your changes.
2323
//
24-
// .package(url: "https://github.com/apple/swift-syntax", branch: "main")
25-
.package(path: "..")
24+
.package(url: "https://github.com/apple/swift-syntax", branch: "main")
25+
// .package(path: "..")
2626
],
2727
targets: [
2828
.executableTarget(

Sources/SwiftSyntax/SyntaxArena.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ public class SyntaxArena {
163163
func addChild(_ otherRef: SyntaxArenaRef) {
164164
if SyntaxArenaRef(self) == otherRef { return }
165165

166-
#if DEBUG || SWIFTSYNTAX_ENABLE_ASSERTIONS
167-
precondition(
168-
!self.hasParent,
169-
"an arena can't have a new child once it's owned by other arenas"
170-
)
171-
#endif
166+
#if DEBUG || SWIFTSYNTAX_ENABLE_ASSERTIONS
167+
precondition(
168+
!self.hasParent,
169+
"an arena can't have a new child once it's owned by other arenas"
170+
)
171+
#endif
172172

173173
if childRefs.insert(otherRef).inserted {
174174
otherRef.retain()

Sources/SwiftSyntax/generated/SyntaxRewriter.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//// Automatically generated by generate-swiftsyntax
1+
//// Automatically generated by generate-swift-syntax
22
//// Do not edit directly!
33
//===----------------------------------------------------------------------===//
44
//
@@ -1784,6 +1784,13 @@ open class SyntaxRewriter {
17841784
return ExprSyntax(visitChildren(node))
17851785
}
17861786

1787+
/// Visit a ``ThenStmtSyntax``.
1788+
/// - Parameter node: the node that is being visited
1789+
/// - Returns: the rewritten node
1790+
open func visit(_ node: ThenStmtSyntax) -> StmtSyntax {
1791+
return StmtSyntax(visitChildren(node))
1792+
}
1793+
17871794
/// Visit a ``ThrowStmtSyntax``.
17881795
/// - Parameter node: the node that is being visited
17891796
/// - Returns: the rewritten node
@@ -3064,6 +3071,10 @@ open class SyntaxRewriter {
30643071
return {
30653072
self.visitImpl($0, TernaryExprSyntax.self, self.visit)
30663073
}
3074+
case .thenStmt:
3075+
return {
3076+
self.visitImpl($0, ThenStmtSyntax.self, self.visit)
3077+
}
30673078
case .throwStmt:
30683079
return {
30693080
self.visitImpl($0, ThrowStmtSyntax.self, self.visit)
@@ -3688,6 +3699,8 @@ open class SyntaxRewriter {
36883699
return visitImpl(data, SwitchExprSyntax.self, visit)
36893700
case .ternaryExpr:
36903701
return visitImpl(data, TernaryExprSyntax.self, visit)
3702+
case .thenStmt:
3703+
return visitImpl(data, ThenStmtSyntax.self, visit)
36913704
case .throwStmt:
36923705
return visitImpl(data, ThrowStmtSyntax.self, visit)
36933706
case .tryExpr:

0 commit comments

Comments
 (0)