GrammarToken
Defined in: prism/types.ts:54
The expansion of a simple RegExp
literal to support additional properties.
Properties
Section titled “Properties”alias?
Section titled “alias?”
optional
alias:TokenName
Defined in: prism/types.ts:74
An optional alias. Multiple aliases are separated by spaces.
greedy?
Section titled “greedy?”
optional
greedy:boolean
Defined in: prism/types.ts:70
Whether the token is greedy.
Default
Section titled “Default”false
inside?
Section titled “inside?”
optional
inside:null
|string
|Grammar
Defined in: prism/types.ts:85
The nested grammar of this token.
The inside
grammar will be used to tokenize the text value of each token of this kind.
This can be used to make nested and even recursive language definitions.
Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into each another.
lookbehind?
Section titled “lookbehind?”
optional
lookbehind:boolean
Defined in: prism/types.ts:64
If true
, then the first capturing group of pattern
will (effectively) behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
Default
Section titled “Default”false
pattern
Section titled “pattern”pattern:
RegExp
Defined in: prism/types.ts:58
The regular expression of the token.