Skip to content

OrPattern

kareman edited this page Aug 13, 2020 · 4 revisions

OrPattern

A pattern which first tries the first pattern, if that fails it tries the second pattern from the same position.

public struct OrPattern<First: Pattern, Second: Pattern>: Pattern where First.Input == Second.Input

Inheritance

Pattern, RegexConvertible

Nested Type Aliases

Input

public typealias Input = First.Input

Initializers

init(_:or:)

@inlinable init(_ first: First, or second: Second)

Properties

first

let first: First

second

let second: Second

description

var description: String

Methods

createInstructions(_:)

@inlinable public func createInstructions(_ instructions: inout ContiguousArray<Instruction<Input>>) throws
Clone this wiki locally