Type alias State<CTX>

State<CTX>: {
    col: number;
    context: immutable.Stack<Located<CTX>>;
    indent: number;
    offset: number;
    row: number;
    src: string;
}

The state is the current state of the parser. It contains the source string, offest, indent, row and column. It tells the parser where it is.

Important: The offset is in BYTES because some UTF-16 characters are TWO bytes such as emojis.

Type Parameters

  • CTX

Type declaration

  • col: number
  • context: immutable.Stack<Located<CTX>>
  • indent: number
  • offset: number
  • row: number
  • src: string