mdz_token_parser.ts view source
import {MdzTokenParser} from '@fuzdev/mdz/mdz_token_parser.js'; Builds an MdzNode[] tree from a lexed MdzToken[] stream.
Used by mdz_parse, which should be preferred for simple usage.
constructor
type new (tokens: MdzToken[]): MdzTokenParser
tokens
MdzToken[]reset
Rebind to a new token stream and rewind, so one parser instance can be
reused across inputs — the streaming table path reuses one across a row's
cells via MdzTableCellParser.
type (tokens: MdzToken[]): void
tokens
MdzToken[]voidparse
type (): MdzNode[]
MdzNode[]parse_inline_run
Parse the entire token stream as a single inline run — used for table
cells, whose tokens come from MdzLexer.lex_table_cell. Adjacent text
merges as it accumulates, matching #parse_table_cell.
type (): MdzNode[]
MdzNode[]