Module

x/ohm_js/index.d.ts>MatchResult

A library and language for building parsers, interpreters, compilers, etc.
Latest
interface MatchResult
import { type MatchResult } from "https://dotland.deno.dev/x/ohm_js@v17.1.0/index.d.ts";

Result of Grammar#match

Properties

optional
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).

optional
shortMessage: string

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

Methods

succeeded(): boolean

True iff match succeeded

failed(): boolean

True iff match did not succeed

getInterval(): Interval

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