Keyword
public class Keyword : PatternElement, Equatable
Keyword instances are used to provide static points in match sequences so that they can be used as pillars of the expressions the developer tries to match
-
The type of the Keyword determines whether the item holds some special purpose, or it’s just an ordinary static String
See moreDeclaration
Swift
public enum KeywordType : Equatable -
Name (and value) of the
KeywordDeclaration
Swift
let name: String -
Type of the keyword, which gives the framework some extra semantics about its nature
Declaration
Swift
let type: KeywordType -
KeywordinitialiserDeclaration
Swift
public init(_ name: String, type: KeywordType = .generic)Parameters
nameThe name (and value) of the
KeywordtypeType of the keyword, which gives the framework some extra semantics about its nature. Defaults to
KeywordType.generic -
Keywordinstances are returning exactMatch, when they are equal to theprefixinput. If the input is really just a prefix of the keyword, possible metch is returned. noMatch otherwise.Declaration
Swift
public func matches(prefix: String, options: PatternOptions = []) -> MatchResult<Any>Parameters
prefixThe input
optionsOptions that modify the matching algorithm
Return Value
The result of the match operation
-
Keywordinstances areEquatablesDeclaration
Swift
public static func == (lhs: Keyword, rhs: Keyword) -> BoolParameters
lhsLeft hand side
rhsRight hand side
Return Value
Whether the names and types are equal in
lhsandrhs
View on GitHub
Install in Dash
Keyword Class Reference