PatternProtocol
public protocol PatternProtocol
Pattern consists of array of elements
-
Matcher
instances are capable of recognising patterns described in theelements
collection. It only remains effective, if theVariable
instances are surrounded byKeyword
instances, so no twoVariable
s 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 theMatcher
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 }