Skip to content

Capture

kareman edited this page Aug 13, 2020 · 4 revisions

Capture

Captures the current position as a range.

public struct Capture<Wrapped: Pattern>: Pattern

It can be retrieved in Parser.Match.captures or used for decoding into Decodables.

Inheritance

Pattern, RegexConvertible

Nested Type Aliases

Input

public typealias Input = Wrapped.Input

Initializers

init(name:_:)

Captures the position of wrapped as a range.

@inlinable public init(name: String? = nil, _ wrapped: Wrapped)

Parameters

  • name: - name: optional name

init(name:)

Captures the current input position as an empty range.

@inlinable public init<Input>(name: String? = nil) where Wrapped == NoPattern<Input>

Parameters

  • name: - name: optional name

init(name:)

Captures the current input position as an empty range.

@inlinable public init(name: String? = nil) where Wrapped == NoPattern<String>

Parameters

  • name: - name: optional name

init(name:_:)

Captures the position of wrapped as a range.

@inlinable public init<Input>(name: String? = nil, _ wrapped: Literal<Input>) where Wrapped == Literal<Input>

Parameters

  • name: - name: optional name

Properties

description

var description: String

name

let name: String?

wrapped

let wrapped: Wrapped

Methods

createInstructions(_:)

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