Skip to main content
Module

x/kilatgraphql/mod.ts>Token

Graphql middleware
Latest
class Token
import { Token } from "https://deno.land/x/kilatgraphql@16.6.0-1/mod.ts";

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

Constructors

new
Token(
kind: TokenKind,
start: number,
end: number,
line: number,
column: number,
value?: string,
)

Properties

readonly
column: number

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

readonly
end: number

The character offset at which this Node ends.

readonly
kind: TokenKind

The kind of Token.

readonly
line: number

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

readonly
next: Token | null
readonly
prev: Token | null

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

readonly
start: number

The character offset at which this Node begins.

readonly
value: string

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

Note: is undefined for punctuation tokens, but typed as string for convenience in the parser.

readonly
[Symbol.toStringTag]: string

Methods

toJSON(): { kind: TokenKind; value?: string; line: number; column: number; }