MatchResult

public enum MatchResult : CustomStringConvertible

Match results are passed from Rules to IntermediateRepresentations and provide all information required to create an AST or even begin interpretting the results of the match.

  • The match was successful

    Declaration

    Swift

    case success(context: LexicalContext)
  • The match was successful but no token should be issued

    Declaration

    Swift

    case consume(context: LexicalContext)
  • The match failed, but that failure is OK

    Declaration

    Swift

    case ignoreFailure(atIndex: String.UnicodeScalarView.Index)
  • The match failed

    Declaration

    Swift

    case failure(atIndex: String.UnicodeScalarView.Index)
  • A human readable description of the result

    Declaration

    Swift

    public var description: String { get }
  • The substring of the source that the match was against

    Declaration

    Swift

    public var range: String.UnicodeScalarView.Index { get }
  • The substring of the source that the match was against

    Declaration

    Swift

    public var matchedString: String? { get }