You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug is about the first line in every Package.swift, e.g. // swift-tools-version:5.3.
Currently it only accept a single space character between "//" and "swift-tools-version:5.3". It should allow any number of any horizontal whitespace characters.
The text was updated successfully, but these errors were encountered:
// The regex to match swift tools version specification:// * It should start with `//` followed by any amount of whitespace.// * Following that it should contain the case insensitive string `swift-tools-version:`.// * The text between the above string and `;` or string end becomes the tools version specifier.staticletregex = try! NSRegularExpression(
pattern: "^// swift-tools-version:(.*?)(?:;.*|$)",options: [.caseInsensitive])
The regex intends to match "any amount of whitespace followed by //" (according to the comments in the code snippet above), but in its implementation, it matches only 1 space character.
This can be easily fixed, but I want to use this bug report to ask if it was a conscious design choice to allow only 1 space character, and shouldn't be changed.
Additional Detail from JIRA
md5: 95510fb6c4f0933086d339be5d484ac3
Issue Description:
This bug is about the first line in every
Package.swift
, e.g.// swift-tools-version:5.3
.Currently it only accept a single space character between "//" and "swift-tools-version:5.3". It should allow any number of any horizontal whitespace characters.
The text was updated successfully, but these errors were encountered: