PatternProtocol

public protocol PatternProtocol

Pattern consists of array of elements

  • Matcher instances are capable of recognising patterns described in the elements collection. It only remains effective, if the Variable instances are surrounded by Keyword instances, so no two Variables should be next to each other. Otherwise, their matching result and value would be undefined. This collection should be provided during the initialisation, and cannot be modified once the Matcher instance has been created.

    Declaration

    Swift

    var elements: [PatternElement] { get }
  • Options that modify the pattern matching algorithm

    Declaration

    Swift

    var options: PatternOptions { get }
  • Optional name to identify the pattern. If not provided during initialisation, it will fall back to the textual representation of the elements array

    Declaration

    Swift

    var name: String { get }