-
Notifications
You must be signed in to change notification settings - Fork 1
OneOf
kareman edited this page Aug 13, 2020
·
4 revisions
Matches and consumes a single element.
public struct OneOf<Input: BidirectionalCollection>: Pattern where Input.Element: Hashable & Comparable
@usableFromInline init(description: String, regex: String? = nil, group: Group<Input.Element>)
Matches any element for which contains
returns true
.
@inlinable public init(description: String, regex: String? = nil, contains: @escaping (Input.Element) -> Bool)
- description: - description: A descriptive identifier for textual representation of the pattern.
- regex: - regex: An optional regex matching the same elements.
- contains: - contains: A closure returning true for any element that matches.
Matches any element for which contains
returns true
.
@inlinable public init(description: String, regex: String? = nil, contains: @escaping (Input.Element) -> Bool) where Input == String
- description: - description: A descriptive identifier for textual representation of the pattern.
- regex: - regex: An optional regex matching the same elements.
- contains: - contains: A closure returning true for any element that matches.
Matches any elements in elements
.
@inlinable public init(_ elements: Input)
- elements: - elements: A sequence of elements to match.
Matches any elements not in elements
.
@inlinable public init(not elements: Input)
- elements: - elements: A sequence of elements not to match.
@usableFromInline internal init(closures: [(Input.Element) -> Bool], description: String, isNegated: Bool = false)
Matches any of the provided elements.
@inlinable public init<O1: OneOfConvertible>(_ o1: O1) where Input.Element == O1.Element
Matches any of the provided elements.
@inlinable public init<O1: OneOfConvertible, O2: OneOfConvertible>(_ o1: O1, _ o2: O2) where Input.Element == O1.Element, O1.Element == O2.Element
Matches any of the provided elements.
@inlinable public init<O1: OneOfConvertible, O2: OneOfConvertible, O3: OneOfConvertible>(_ o1: O1, _ o2: O2, _ o3: O3) where Input.Element == O1.Element, O1.Element == O2.Element, O2.Element == O3.Element
Matches any of the provided elements.
@inlinable public init<O1: OneOfConvertible, O2: OneOfConvertible, O3: OneOfConvertible, O4: OneOfConvertible>(_ o1: O1, _ o2: O2, _ o3: O3, _ o4: O4) where Input.Element == O1.Element, O1.Element == O2.Element, O2.Element == O3.Element, O3.Element == O4.Element
Matches any but the provided elements.
@inlinable public init<O1: OneOfConvertible>(not o1: O1) where Input.Element == O1.Element
Matches any but the provided elements.
@inlinable public init<O1: OneOfConvertible, O2: OneOfConvertible>(not o1: O1, _ o2: O2) where Input.Element == O1.Element, O1.Element == O2.Element
Matches any but the provided elements.
@inlinable public init<O1: OneOfConvertible, O2: OneOfConvertible, O3: OneOfConvertible>(not o1: O1, _ o2: O2, _ o3: O3) where Input.Element == O1.Element, O1.Element == O2.Element, O2.Element == O3.Element
Matches any of the provided elements.
@inlinable public init<O1: OneOfConvertible, O2: OneOfConvertible, O3: OneOfConvertible, O4: OneOfConvertible>(not o1: O1, _ o2: O2, _ o3: O3, _ o4: O4) where Input.Element == O1.Element, O1.Element == O2.Element, O2.Element == O3.Element, O3.Element == O4.Element
let group: Group<Input.Element>
let description: String
let _regex: String?
var regex: String
@inlinable public func createInstructions(_ instructions: inout ContiguousArray<Instruction<Input>>)
public static func ==(lhs: OneOf, rhs: OneOf) -> Bool
@inlinable public func contains(_ char: Input.Element) -> Bool
Generated at 2020-08-23T12:56:49+0000 using swift-doc 1.0.0-beta.3.