Skip to content

Commit 89b1932

Browse files
[NFC] draw attention to the mismatch between regex's behaviour and its documentation by adding a Bug callout that describes the mismatch.
1 parent a5f6000 commit 89b1932

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/PackageLoading/ToolsVersionLoader.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,8 @@ public class ToolsVersionLoader: ToolsVersionLoaderProtocol {
620620
/// There are 2 capture groups in the regex pattern:
621621
/// 1. The continuous sequence of whitespace characters between "//" and "swift-tools-version".
622622
/// 2. The version specifier.
623+
///
624+
/// - Bug: Although any combination of all _horizontal_ whitespace characters should be allowed between `//`and `swift-tools-version:`, currently only a single space (`U+0020`) is allowed.
623625
@available(swift, deprecated: 5.3.1)
624626
static let regex = try! NSRegularExpression(
625627
pattern: "^// swift-tools-version:(.*?)(?:;.*|$)",

0 commit comments

Comments
 (0)