Skip to content

Commit dd2235f

Browse files
committed
Mark the literal pattern API as SPI
1 parent 0bee970 commit dd2235f

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Sources/RegexBuilder/DSL.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ extension _RegexFactory {
535535
_ left: some RegexComponent,
536536
ignoringOutputTypeOf right: some RegexComponent
537537
) -> Regex<Output> {
538-
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
538+
if #available(macOS 14.0, iOS 9999, watchOS 9999, tvOS 9999, *) {
539539
return accumulate(left, ignoreCapturesInTypedOutput(right))
540540
}
541541
return accumulate(left, right)
@@ -549,7 +549,7 @@ extension _RegexFactory {
549549
ignoringOutputTypeOf left: some RegexComponent,
550550
_ right: some RegexComponent
551551
) -> Regex<Output> {
552-
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
552+
if #available(macOS 14.0, iOS 9999, watchOS 9999, tvOS 9999, *) {
553553
return accumulate(ignoreCapturesInTypedOutput(left), right)
554554
}
555555
return accumulate(left, right)
@@ -563,7 +563,7 @@ extension _RegexFactory {
563563
ignoringOutputTypeOf left: some RegexComponent,
564564
andAlso right: some RegexComponent
565565
) -> Regex<Output> {
566-
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
566+
if #available(macOS 14.0, iOS 9999, watchOS 9999, tvOS 9999, *) {
567567
return accumulate(
568568
ignoreCapturesInTypedOutput(left), ignoreCapturesInTypedOutput(right))
569569
}

Sources/_StringProcessing/LiteralPrinter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension Regex {
2323
/// protocol, this property is `nil`.
2424
///
2525
/// The value of this property may change between different releases of Swift.
26-
// TODO: SPI
26+
@_spi(LiteralPattern)
2727
public var _literalPattern: String? {
2828
var gen = LiteralPrinter(options: MatchingOptions())
2929
gen.outputNode(self.program.tree.root)

Tests/RegexTests/LiteralPrinterTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//===----------------------------------------------------------------------===//
1111

1212
import XCTest
13+
@_spi(LiteralPattern)
1314
import _StringProcessing
1415
import RegexBuilder
1516

Tests/RegexTests/MatchTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import XCTest
1313
@testable import _RegexParser
14-
@testable @_spi(RegexBenchmark) import _StringProcessing
14+
@testable @_spi(RegexBenchmark) @_spi(LiteralPattern) import _StringProcessing
1515
import TestSupport
1616

1717
struct MatchError: Error {

0 commit comments

Comments
 (0)