Class ParseResult<D>

A class for parse successful results.

An object of this type gets returned on parses that matched their target until some specified index. Any semantic value attached to the parse results during parsing is also returned as the data payload of the parse result.

Inside a ParseResult, this should always hold true: result.length <= index <= target.length

See

Identifiable

Type Parameters

  • D extends Identifiable

    The type of the semantic value stored in data. It can vary based on the semantics defined while parsing. It must implement Identifiable

Hierarchy

  • ParseResult

Implements

Constructors

Properties

Accessors

Methods

Constructors

  • Type Parameters

    Parameters

    • target: string
    • index: number
    • result: string[]
    • data: D

    Returns ParseResult<D>

Properties

data: D

The semantic value produced in the parsing process. If no semantics are defined, it defaults to null.

index: number
isError: false = false
result: string[]
target: string

Accessors

Methods