Type alias ParseErrorProduction<E>

ParseErrorProduction<E>: ((target: string, index: number) => E)

Type Parameters

  • E extends Identifiable

    The type of the semantic error value returned.

Type declaration

    • (target: string, index: number): E
    • A callback type for error productions. It gets passed the target and index where an error occured and returns a new semantic error value for it to be added to the returned ParseError of the parser.

      It is used as the type of callback for TokenParser parsers that produce ParseError outcomes.

      Returns

      A new semantic error value

      See

      Parameters

      • target: string

        The target that was parsed.

      • index: number

        The index in target where an error was found.

      Returns E