@@ -33,30 +33,30 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
3333 DeclSyntax ( " public let viewMode: SyntaxTreeViewMode " )
3434 DeclSyntax (
3535 """
36- /// The arena in which the parents of rewritten nodes should be allocated.
36+ /// The raw arena in which the parents of rewritten nodes should be allocated.
3737 ///
3838 /// The `SyntaxRewriter` subclass is responsible for generating the rewritten nodes. To incorporate them into the
3939 /// tree, all of the rewritten node's parents also need to be re-created. This is the arena in which those
40- /// intermediate nodes should be allocated.
41- private let arena: SyntaxArena ?
40+ /// intermediate raw nodes should be allocated.
41+ private let rawArena: RawSyntaxArena ?
4242 """
4343 )
4444
4545 DeclSyntax (
4646 """
4747 public init(viewMode: SyntaxTreeViewMode = .sourceAccurate) {
4848 self.viewMode = viewMode
49- self.arena = nil
49+ self.rawArena = nil
5050 }
5151 """
5252 )
5353
5454 DeclSyntax (
5555 """
5656 @_spi(RawSyntax)
57- public init(viewMode: SyntaxTreeViewMode = .sourceAccurate, arena: SyntaxArena ? = nil) {
57+ public init(viewMode: SyntaxTreeViewMode = .sourceAccurate, rawAllocationArena: RawSyntaxArena ? = nil) {
5858 self.viewMode = viewMode
59- self.arena = arena
59+ self.rawArena = rawAllocationArena
6060 }
6161 """
6262 )
@@ -71,7 +71,7 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
7171 }
7272
7373 return withExtendedLifetime(rewritten) {
74- return Syntax(node).replacingSelf(rewritten.raw, rawNodeArena: rewritten.raw.arenaReference.retained, allocationArena: SyntaxArena ())
74+ return Syntax(node).replacingSelf(rewritten.raw, rawNodeArena: rewritten.raw.arenaReference.retained, rawAllocationArena: RawSyntaxArena ())
7575 }
7676 }
7777 """
@@ -319,9 +319,9 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
319319 // nodes are being collected.
320320 var newLayout: UnsafeMutableBufferPointer<RawSyntax?> = .init(start: nil, count: 0)
321321
322- // Keep 'SyntaxArena ' of rewritten nodes alive until they are wrapped
322+ // Keep 'RawSyntaxArena ' of rewritten nodes alive until they are wrapped
323323 // with 'Syntax'
324- var rewrittens: ContiguousArray<RetainedSyntaxArena > = []
324+ var rewrittens: ContiguousArray<RetainedRawSyntaxArena > = []
325325
326326 for case let childDataRef? in node.layoutBuffer where viewMode.shouldTraverse(node: childDataRef.pointee.raw) {
327327
@@ -347,13 +347,13 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
347347 if newLayout.baseAddress != nil {
348348 // A child node was rewritten. Build the updated node.
349349
350- let arena = self.arena ?? SyntaxArena ()
351- let newRaw = node.raw.layoutView!.replacingLayout(with: newLayout, arena: arena )
350+ let rawArena = self.rawArena ?? RawSyntaxArena ()
351+ let newRaw = node.raw.layoutView!.replacingLayout(with: newLayout, arena: rawArena )
352352 newLayout.deinitialize()
353353 newLayout.deallocate()
354- // 'withExtendedLifetime' to keep 'SyntaxArena 's of them alive until here.
354+ // 'withExtendedLifetime' to keep 'RawSyntaxArena 's of them alive until here.
355355 return withExtendedLifetime(rewrittens) {
356- Syntax(raw: newRaw, rawNodeArena: arena )
356+ Syntax(raw: newRaw, rawNodeArena: rawArena )
357357 }
358358 } else {
359359 // No child node was rewritten. So no need to change this node as well.
0 commit comments