Skip to content

Commit 3bb6692

Browse files
committed
Build _RegexParser without implicit import of _StringProcessing
Explicitly ask the compiler not to implicitly import _StringProessing. This is to avoid a circular dependency when `-enable-experimental-string-processing` is enabled by default.
1 parent c13980f commit 3bb6692

File tree

6 files changed

+1
-17
lines changed

6 files changed

+1
-17
lines changed

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ let package = Package(
3838
dependencies: [],
3939
swiftSettings: [
4040
.unsafeFlags(["-enable-library-evolution"]),
41+
.unsafeFlags(["-Xfrontend", "-disable-implicit-string-processing-module-import"]),
4142
availabilityDefinition
4243
]),
4344
.testTarget(

Sources/_RegexParser/Regex/AST/AST.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ extension AST {
2929

3030
extension AST {
3131
/// A node in the regex AST.
32-
@frozen
3332
public indirect enum Node:
3433
Hashable, _TreeNode //, _ASTPrintable ASTValue, ASTAction
3534
{
@@ -247,7 +246,6 @@ extension AST {
247246
}
248247

249248
public struct Reference: Hashable {
250-
@frozen
251249
public enum Kind: Hashable {
252250
// \n \gn \g{n} \g<n> \g'n' (?n) (?(n)...
253251
// Oniguruma: \k<n>, \k'n'

Sources/_RegexParser/Regex/AST/Atom.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ extension AST {
1919
self.location = loc
2020
}
2121

22-
@frozen
2322
public enum Kind: Hashable {
2423
/// Just a character
2524
///
@@ -115,7 +114,6 @@ extension AST.Atom {
115114

116115
// Characters, character types, literals, etc., derived from
117116
// an escape sequence.
118-
@frozen
119117
public enum EscapedBuiltin: Hashable {
120118
// TODO: better doc comments
121119

@@ -368,7 +366,6 @@ extension AST.Atom {
368366
}
369367

370368
extension AST.Atom.CharacterProperty {
371-
@frozen
372369
public enum Kind: Hashable {
373370
/// Matches any character, equivalent to Oniguruma's '\O'.
374371
case any
@@ -407,7 +404,6 @@ extension AST.Atom.CharacterProperty {
407404
}
408405

409406
// TODO: erm, separate out or fold into something? splat it in?
410-
@frozen
411407
public enum PCRESpecialCategory: String, Hashable {
412408
case alphanumeric = "Xan"
413409
case posixSpace = "Xps"
@@ -419,7 +415,6 @@ extension AST.Atom.CharacterProperty {
419415

420416
extension AST.Atom {
421417
/// Anchors and other built-in zero-width assertions.
422-
@frozen
423418
public enum AssertionKind: String {
424419
/// \A
425420
case startOfSubject = #"\A"#

Sources/_RegexParser/Regex/AST/CustomCharClass.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ extension AST {
2727
self.location = sr
2828
}
2929

30-
@frozen
3130
public enum Member: Hashable {
3231
/// A nested custom character class `[[ab][cd]]`
3332
case custom(CustomCharacterClass)
@@ -59,13 +58,11 @@ extension AST {
5958
self.rhs = rhs
6059
}
6160
}
62-
@frozen
6361
public enum SetOp: String, Hashable {
6462
case subtraction = "--"
6563
case intersection = "&&"
6664
case symmetricDifference = "~~"
6765
}
68-
@frozen
6966
public enum Start: String {
7067
case normal = "["
7168
case inverted = "[^"

Sources/_RegexParser/Regex/AST/Quantification.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ extension AST {
3636
self.trivia = trivia
3737
}
3838

39-
@frozen
4039
public enum Amount: Hashable {
4140
case zeroOrMore // *
4241
case oneOrMore // +
@@ -47,7 +46,6 @@ extension AST {
4746
case range(Located<Int>, Located<Int>) // {n,m}
4847
}
4948

50-
@frozen
5149
public enum Kind: String, Hashable {
5250
case eager = ""
5351
case reluctant = "?"

Sources/_RegexParser/Utility/MissingUnicode.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ extension Unicode {
1919
// other script types.
2020

2121
/// Character script types.
22-
@frozen
2322
public enum Script: String, Hashable {
2423
case adlam = "Adlam"
2524
case ahom = "Ahom"
@@ -188,7 +187,6 @@ extension Unicode {
188187

189188
/// POSIX character properties not already covered by general categories or
190189
/// binary properties.
191-
@frozen
192190
public enum POSIXProperty: String, Hashable {
193191
case alnum = "alnum"
194192
case blank = "blank"
@@ -206,7 +204,6 @@ extension Unicode {
206204

207205
/// Unicode.GeneralCategory + cases for "meta categories" such as "L", which
208206
/// encompasses Lu | Ll | Lt | Lm | Lo.
209-
@frozen
210207
public enum ExtendedGeneralCategory: String, Hashable {
211208
case other = "C"
212209
case control = "Cc"
@@ -257,7 +254,6 @@ extension Unicode {
257254
/// A list of Unicode properties that can either be true or false.
258255
///
259256
/// https://www.unicode.org/Public/UCD/latest/ucd/PropertyAliases.txt
260-
@frozen
261257
public enum BinaryProperty: String, Hashable {
262258
case asciiHexDigit = "ASCII_Hex_Digit"
263259
case alphabetic = "Alphabetic"
@@ -333,7 +329,6 @@ extension Unicode {
333329
// property.
334330

335331
/// Oniguruma properties that are not covered by Unicode spellings.
336-
@frozen
337332
public enum OnigurumaSpecialProperty: String, Hashable {
338333
case inBasicLatin = "In_Basic_Latin"
339334
case inLatin1Supplement = "In_Latin_1_Supplement"

0 commit comments

Comments
 (0)