Skip to content

Commit

Permalink
[NFC] draw attention to the mismatch between regex's behaviour and …
Browse files Browse the repository at this point in the history
…its documentation by adding a `Bug` callout that describes the mismatch.
  • Loading branch information
WowbaggersLiquidLunch committed Nov 4, 2020
1 parent a5f6000 commit 89b1932
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/PackageLoading/ToolsVersionLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,8 @@ public class ToolsVersionLoader: ToolsVersionLoaderProtocol {
/// There are 2 capture groups in the regex pattern:
/// 1. The continuous sequence of whitespace characters between "//" and "swift-tools-version".
/// 2. The version specifier.
///
/// - 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.
@available(swift, deprecated: 5.3.1)
static let regex = try! NSRegularExpression(
pattern: "^// swift-tools-version:(.*?)(?:;.*|$)",
Expand Down

0 comments on commit 89b1932

Please sign in to comment.