type alias SimpleLexerTokenDefinition

A definition for a token type for SimpleLexer.

Type Parameters

T extends keyof any = keyof any

Properties

The name of the token.

pattern: string | RegExp

The pattern used for this token.

Specify a string for an exact match. Specify a RegExp for more complicated patterns.

Note: Keep in mind that patterns will be combined into a single concatenated RegExp with the uy flags (or iuy if ignoreCase option is true). Flags set on the patterns in the token definition itself will be ignored.

Usage

import { type SimpleLexerTokenDefinition } from ".";