Skip to content

Literal

kareman edited this page Jul 1, 2020 · 5 revisions

Literal

Matches a sequence of elements.

public struct Literal: Pattern

If empty, it will always succeed without consuming any input.

Inheritance

ExpressibleByStringLiteral, Pattern, RegexConvertible

Initializers

init(_:)

Matches sequence.

@inlinable public init<S: Sequence>(_ sequence: S) where S.Element == Pattern.Input.Element

init(_:)

Matches this character.

@inlinable public init(_ character: Character)

init(stringLiteral:)

@inlinable public init(stringLiteral value: StaticString)

Properties

elements

let elements: Input

description

var description: String

regex

var regex: String

Methods

createInstructions(_:)

@inlinable public func createInstructions(_ instructions: inout Instructions)

&&(me:)

Matches the following pattern without consuming any input.

@inlinable public static prefix func &&(me: Literal) -> AndPattern<Literal>
Clone this wiki locally