Step 2: Implementation
Implement the custom tokens
Constant tokens
const severity = defineToken('severity', {
constant(this: RegExpToken) {
// Append a constant expression
return this.oneOf`error``warning``info``debug`;
},
});
const matchAll = defineToken('matchAll', {
constant(this: RegExpToken) {
// Wrap around the existing expression
return lineStart.match(this).lineEnd;
},
});Dynamic tokens
Mixed tokens
Last updated