Result of Grammar#match

interface MatchResult {
    message?: string;
    shortMessage?: string;
    failed(): boolean;
    getInterval(): Interval;
    succeeded(): boolean;
}

Properties

message?: string

If match failed contains an error message indicating where and why the match failed. This message is suitable for end users of a language (i.e., people who do not have access to the grammar source).

shortMessage?: string

If match failed contains an abbreviated version of this.message that does not include an excerpt from the invalid input.

Methods

  • True iff match did not succeed

    Returns boolean

  • If this MatchResult is a failure, returns an Interval indicating the position of the rightmost failure.

    Returns Interval

  • True iff match succeeded

    Returns boolean

Generated using TypeDoc