Represents a range of characters represented by a lexical token within a Source.

Constructors

Properties

Methods

Constructors

  • Parameters

    • kind: TokenKindEnum
    • start: number
    • end: number
    • line: number
    • column: number
    • prev: null | Token
    • Optional value: string

    Returns Token

Properties

column: number

The 1-indexed column number at which this Token begins.

end: number

The character offset at which this Node ends.

The kind of Token.

line: number

The 1-indexed line number on which this Token appears.

next: null | Token
prev: null | Token

Tokens exist as nodes in a double-linked-list amongst all tokens including ignored tokens. is always the first node and the last.

start: number

The character offset at which this Node begins.

value: undefined | string

For non-punctuation tokens, represents the interpreted value of the token.

Methods

  • Returns {
        column: number;
        kind: TokenKindEnum;
        line: number;
        value: undefined | string;
    }

    • column: number
    • kind: TokenKindEnum
    • line: number
    • value: undefined | string