Consumer

public indirect enum Consumer<Label> : Equatable, Sendable where Label : Hashable, Label : Sendable
extension Consumer: ExpressibleByStringLiteral, ExpressibleByArrayLiteral
extension Consumer: CustomStringConvertible

Undocumented

Matching

Syntax sugar

Character sets

Composite rules

  • Matches a list of zero or more consumer instances

    Declaration

    Swift

    static func zeroOrMore(_ consumer: Consumer) -> Consumer
  • Matches one or more consumer instances, separated by an instance of separator This is useful for something like a comma-delimited list (without a trailing comma)

    Declaration

    Swift

    static func interleaved(_ consumer: Consumer, _ separator: Consumer) -> Consumer
  • Matches the target consumer, ignoring any instances of the ignored consumer This is useful for something like ignoring whitespace between tokens Note: Instances of ignored inside flatten clauses will not be ignored

    Declaration

    Swift

    static func ignore(_ ignored: Consumer, in target: Consumer) -> Consumer

Consumer implementation

  • Human-readable description of what consumer matches

    Declaration

    Swift

    public var description: String { get }