@@ -33,30 +33,30 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
33
33
DeclSyntax ( " public let viewMode: SyntaxTreeViewMode " )
34
34
DeclSyntax (
35
35
"""
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.
37
37
///
38
38
/// The `SyntaxRewriter` subclass is responsible for generating the rewritten nodes. To incorporate them into the
39
39
/// 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 ?
42
42
"""
43
43
)
44
44
45
45
DeclSyntax (
46
46
"""
47
47
public init(viewMode: SyntaxTreeViewMode = .sourceAccurate) {
48
48
self.viewMode = viewMode
49
- self.arena = nil
49
+ self.rawArena = nil
50
50
}
51
51
"""
52
52
)
53
53
54
54
DeclSyntax (
55
55
"""
56
56
@_spi(RawSyntax)
57
- public init(viewMode: SyntaxTreeViewMode = .sourceAccurate, arena: SyntaxArena ? = nil) {
57
+ public init(viewMode: SyntaxTreeViewMode = .sourceAccurate, rawAllocationArena: RawSyntaxArena ? = nil) {
58
58
self.viewMode = viewMode
59
- self.arena = arena
59
+ self.rawArena = rawAllocationArena
60
60
}
61
61
"""
62
62
)
@@ -71,7 +71,7 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
71
71
}
72
72
73
73
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 ())
75
75
}
76
76
}
77
77
"""
@@ -319,9 +319,9 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
319
319
// nodes are being collected.
320
320
var newLayout: UnsafeMutableBufferPointer<RawSyntax?> = .init(start: nil, count: 0)
321
321
322
- // Keep 'SyntaxArena ' of rewritten nodes alive until they are wrapped
322
+ // Keep 'RawSyntaxArena ' of rewritten nodes alive until they are wrapped
323
323
// with 'Syntax'
324
- var rewrittens: ContiguousArray<RetainedSyntaxArena > = []
324
+ var rewrittens: ContiguousArray<RetainedRawSyntaxArena > = []
325
325
326
326
for case let childDataRef? in node.layoutBuffer where viewMode.shouldTraverse(node: childDataRef.pointee.raw) {
327
327
@@ -347,13 +347,13 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
347
347
if newLayout.baseAddress != nil {
348
348
// A child node was rewritten. Build the updated node.
349
349
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 )
352
352
newLayout.deinitialize()
353
353
newLayout.deallocate()
354
- // 'withExtendedLifetime' to keep 'SyntaxArena 's of them alive until here.
354
+ // 'withExtendedLifetime' to keep 'RawSyntaxArena 's of them alive until here.
355
355
return withExtendedLifetime(rewrittens) {
356
- Syntax(raw: newRaw, rawNodeArena: arena )
356
+ Syntax(raw: newRaw, rawNodeArena: rawArena )
357
357
}
358
358
} else {
359
359
// No child node was rewritten. So no need to change this node as well.
0 commit comments