Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/frugal/docs/dep/prism.ts>TokenObject

A frugal web framework
Go to Latest
interface TokenObject
import { type TokenObject } from "https://deno.land/x/frugal@0.5.0/docs/dep/prism.ts";

The expansion of a simple RegExp literal to support additional properties.

Properties

pattern: RegExp

The regular expression of the token.

optional
lookbehind: boolean | undefined

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.

optional
greedy: boolean | undefined

Whether the token is greedy.

optional
alias: string | string[] | undefined

An optional alias or list of aliases.

optional
inside: Grammar | undefined

The nested tokens of this token.

This can be used for recursive language definitions.

Note that this can cause infinite recursion.