Search


Search something to see results

Context

interface Context<Type> {
    index: number;
    length: number;
    clone<Type>(): Context<Type>;
    consume<Type>(token: Type, howMany?: number): boolean;
    consume<Type>(token: Type, howMany?: number): boolean;
    current<Type>(): Type | null;
    done(): boolean;
    next<Type>(): Type | null;
    peek<Type>(): Type | null;
    slice<Type>(): Type[];
    update<Type>(context: Context<Type>): void;
}

Type Parameters

  • Type

Index

Methods

Properties

Type Parameters

  • Type

Returns Context<Type>

Type Parameters

  • Type

Parameters

  • token: Type
  • OptionalhowMany: number

Returns boolean

Type Parameters

  • Type

Parameters

  • token: Type
  • OptionalhowMany: number

Returns boolean

Type Parameters

  • Type

Returns Type | null

Returns boolean

Type Parameters

  • Type

Returns Type | null

Type Parameters

  • Type

Returns Type | null

Type Parameters

  • Type

Returns Type[]

Type Parameters

  • Type

Parameters

Returns void

index: number
length: number

The length of the context tokens to be consumed