Skip to content

Token

Defined in: prism/core.d.ts:46

new Token(type, content, matchedStr, alias?): Token

Defined in: prism/core.d.ts:82

Creates a new token.

TokenName

See Token.type

See Token.content

string | TokenStream

string

A copy of the full string this token was created from.

TokenName

The alias(es) of the token.

Token

optional alias: TokenName

Defined in: prism/core.d.ts:72

The alias(es) of the token. Multiple aliases are separated by spaces.

GrammarToken.alias


content: string | TokenStream

Defined in: prism/core.d.ts:61

The strings or tokens contained by this token.

This will be a token stream if the pattern matched also defined an inside grammar.


length: number

Defined in: prism/core.d.ts:64

Length of the full string this token was created from.


type: TokenName

Defined in: prism/core.d.ts:54

The type of the token.

This is usually the key of a pattern in a Grammar.

GrammarToken