Token
Defined in: prism/core.d.ts:46
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Token(
type,content,matchedStr,alias?):Token
Defined in: prism/core.d.ts:82
Creates a new token.
Parameters
Section titled “Parameters”See Token.type
content
Section titled “content”See Token.content
string | TokenStream
matchedStr
Section titled “matchedStr”string
A copy of the full string this token was created from.
alias?
Section titled “alias?”The alias(es) of the token.
Returns
Section titled “Returns”Token
Properties
Section titled “Properties”alias?
Section titled “alias?”
optionalalias:TokenName
Defined in: prism/core.d.ts:72
The alias(es) of the token. Multiple aliases are separated by spaces.
content
Section titled “content”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
Section titled “length”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.