calm.template — Lilush API

←index

← calm

Overview

CALM template DSL parser and sequence builder.

Template is a string with semicolon-separated entries.

Template spec syntaxDescription
BOSbare token
CWD:cwdsimple frame: <CWD> bytes <END>
ENV:env*repeated frame: per item <ENV> bytes <END>
COMP:completions+NEXT-separated list: <COMP> a <NEXT> b ... <END>
HIST(cmd):history*/EXIT:exitrepeated with subtoken
WORD:headword/POS:posframe with subtoken (non-repeated)
WORD:input/ATN/POS:posframe_sub with embedded bare token
ATNbare
CMD:inputlast frame after ATN is terminal (no <END>)

Functions

NameSignature
parseparse(spec) -> elements, err
buildbuild(elements, opts, budget) -> tokens
validatevalidate(spec) -> ok, err

parse(spec) -> elements, err

Parse a template spec string into an element descriptor array

build(elements, opts, budget) -> tokens

Build a token sequence from a parsed template and an opts table

validate(spec) -> ok, err

Validate a template spec string