Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kimdv committed Sep 14, 2023
1 parent 807698a commit 48f514b
Show file tree
Hide file tree
Showing 18 changed files with 703 additions and 40,910 deletions.
4 changes: 2 additions & 2 deletions CodeGeneration/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ let package = Package(
// checkout of swift-syntax that is unaffected by the newly generated files.
// Be sure to revert the change before committing your changes.
//
// .package(url: "https://github.com/apple/swift-syntax", branch: "main")
.package(path: "..")
.package(url: "https://github.com/apple/swift-syntax", branch: "main")
// .package(path: "..")
],
targets: [
.executableTarget(
Expand Down
12 changes: 6 additions & 6 deletions Sources/SwiftSyntax/SyntaxArena.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ public class SyntaxArena {
func addChild(_ otherRef: SyntaxArenaRef) {
if SyntaxArenaRef(self) == otherRef { return }

#if DEBUG || SWIFTSYNTAX_ENABLE_ASSERTIONS
precondition(
!self.hasParent,
"an arena can't have a new child once it's owned by other arenas"
)
#endif
#if DEBUG || SWIFTSYNTAX_ENABLE_ASSERTIONS
precondition(
!self.hasParent,
"an arena can't have a new child once it's owned by other arenas"
)
#endif

if childRefs.insert(otherRef).inserted {
otherRef.retain()
Expand Down
15 changes: 14 additions & 1 deletion Sources/SwiftSyntax/generated/SyntaxRewriter.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//// Automatically generated by generate-swiftsyntax
//// Automatically generated by generate-swift-syntax
//// Do not edit directly!
//===----------------------------------------------------------------------===//
//
Expand Down Expand Up @@ -1784,6 +1784,13 @@ open class SyntaxRewriter {
return ExprSyntax(visitChildren(node))
}

/// Visit a ``ThenStmtSyntax``.
/// - Parameter node: the node that is being visited
/// - Returns: the rewritten node
open func visit(_ node: ThenStmtSyntax) -> StmtSyntax {
return StmtSyntax(visitChildren(node))
}

/// Visit a ``ThrowStmtSyntax``.
/// - Parameter node: the node that is being visited
/// - Returns: the rewritten node
Expand Down Expand Up @@ -3064,6 +3071,10 @@ open class SyntaxRewriter {
return {
self.visitImpl($0, TernaryExprSyntax.self, self.visit)
}
case .thenStmt:
return {
self.visitImpl($0, ThenStmtSyntax.self, self.visit)
}
case .throwStmt:
return {
self.visitImpl($0, ThrowStmtSyntax.self, self.visit)
Expand Down Expand Up @@ -3688,6 +3699,8 @@ open class SyntaxRewriter {
return visitImpl(data, SwitchExprSyntax.self, visit)
case .ternaryExpr:
return visitImpl(data, TernaryExprSyntax.self, visit)
case .thenStmt:
return visitImpl(data, ThenStmtSyntax.self, visit)
case .throwStmt:
return visitImpl(data, ThrowStmtSyntax.self, visit)
case .tryExpr:
Expand Down

0 comments on commit 48f514b

Please sign in to comment.