Interface TwingTokenStream

interface TwingTokenStream {
    current: Token;
    source: TwingSource;
    expect(type, value?, message?): Token;
    injectTokens(tokens): void;
    isEOF(): boolean;
    look(number): Token;
    next(): Token;
    nextIf(primary, secondary?): Token;
    test(type, value?): boolean;
    toAst(): Token[];
}

Properties

current: Token
source: TwingSource

Methods

  • Tests a token and returns it or throws a syntax error.

    Parameters

    • type: TokenType
    • Optional value: null | string | number | string[]
    • Optional message: null | string

    Returns Token

  • Parameters

    • primary: TokenType
    • Optional secondary: string | string[]

    Returns Token

  • Parameters

    • type: TokenType
    • Optional value: string | number | string[]

    Returns boolean

Generated using TypeDoc