Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Sources/_StringProcessing/Regex/AnyRegexOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,12 @@ extension Regex where Output == AnyRegexOutput {
/// ``init(_:as:)`` initializer instead.
///
/// - Parameter pattern: A string with regular expression syntax.
@_effects(readnone)
public init(_ pattern: String) throws {
self.init(ast: try parse(pattern, .traditional))
}

@_effects(readnone)
internal init(_ pattern: String, syntax: SyntaxOptions) throws {
self.init(ast: try parse(pattern, syntax))
}
Expand Down Expand Up @@ -212,6 +214,7 @@ extension Regex {
/// - Parameters:
/// - pattern: A string with regular expression syntax.
/// - outputType: The desired type for the output captures.
@_effects(readnone)
public init(
_ pattern: String,
as outputType: Output.Type = Output.self
Expand Down
1 change: 1 addition & 0 deletions Sources/_StringProcessing/Regex/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public struct Regex<Output>: RegexComponent {
}

// Compiler interface. Do not change independently.
@_effects(readnone)
@usableFromInline
init(_regexString pattern: String) {
self.init(ast: try! parse(pattern, .traditional))
Expand Down