ohmjs / ohm

A library and language for building parsers, interpreters, compilers, etc.
MIT License
5.01k stars 217 forks source link

Typescript MatchResult object incomplete #494

Open tonydoesathing opened 1 month ago

tonydoesathing commented 1 month ago

Version: 17.1.0

Noticed the following when it comes to the types; current MatchResults interface only contains the following:

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

On inspection, looks like it's missing the following fields:

input:string;
matcher: Matcher;
startExpr:Seq;
getExpectedText(): string;
getRightmostFailurePosition(): number;
getRightmostFailures(): Failure[];
pdubroy commented 2 weeks ago

Thanks, yes! We should update the type definitions. Will try to push something out in the next week or so.