@@ -141,7 +141,7 @@ fileprivate struct SourceLocationDirectiveArguments {
141
141
/// Converts ``AbsolutePosition``s of syntax nodes to ``SourceLocation``s, and
142
142
/// vice-versa. The ``AbsolutePosition``s must be originating from nodes that are
143
143
/// part of the same tree that was used to initialize this class.
144
- public final class SourceLocationConverter {
144
+ public final class SourceLocationConverter : Sendable {
145
145
private let fileName : String
146
146
/// The source of the file, modeled as data so it can contain invalid UTF-8.
147
147
private let source : [ UInt8 ]
@@ -157,7 +157,7 @@ public final class SourceLocationConverter {
157
157
/// `#sourceLocation(...)` directive within the current file.
158
158
/// - `arguments` are the `file` and `line` arguments of the directive or `nil`
159
159
/// if spelled as `#sourceLocation()` to reset the source location directive.
160
- private var sourceLocationDirectives : [ ( sourceLine: Int , arguments: SourceLocationDirectiveArguments ? ) ] = [ ]
160
+ private let sourceLocationDirectives : [ ( sourceLine: Int , arguments: SourceLocationDirectiveArguments ? ) ]
161
161
162
162
/// Create a new ``SourceLocationConverter`` to convert between ``AbsolutePosition``
163
163
/// and ``SourceLocation`` in a syntax tree.
@@ -212,6 +212,7 @@ public final class SourceLocationConverter {
212
212
return computeLines ( SyntaxText ( buffer: syntaxArenaBuf) )
213
213
}
214
214
precondition ( source. utf8. count == endOfFile. utf8Offset)
215
+ self . sourceLocationDirectives = [ ]
215
216
}
216
217
217
218
/// Execute the body with an array that contains each source line.
0 commit comments