Type alias Good<A, CTX>Internal

Good<A, CTX>: {
    haveConsumed: boolean;
    kind: "Good";
    state: State<CTX>;
    value: A;
}

If a step is Good it means the parser succeeded and returned a value. It contains the new state of the parser, and whether or not the parser is allowed to backtrack.

Backtraking means that if the parser fails, it can try another path. You can read more here.

Remarks

  • state: the current state of the parser.
  • value: the value that has been parsed.

Type Parameters

  • A

  • CTX

Type declaration

  • Readonly haveConsumed: boolean
  • Readonly kind: "Good"
  • Readonly state: State<CTX>
  • Readonly value: A