23. Reserved Words
Because a type only ever appears in bars (|box|) and an id always wears a #, type
names are free as ids and ids are free as type names — |block#oval| is fine, and
block -> oval is two ordinary nodes. A small set of words stays reserved:
node,link, and the structural class namestext,marker,canvas,scene,cut: not instantiable types —nodeis the umbrella concept (write|block|for the bare box), links are drawn by operators and styled by|-|(|link|is an error), and a define may not take one of these (its generated.lini-<name>would collide with a built-in SVG class —|-|lowers to the reserved.lini-link).
The lini- prefix is reserved for generated names: desugar generates the type
classes (.lini-block, .lini-box, .lini-<define>) and mints ids
(#lini-topic-N — SPEC 12), so a user class or an authored id
may not begin lini-. User classes are emitted .lini-style-<name>. The
highlighter’s token classes (.lini-tok-<kind> — SPEC 20) take the
same prefix for the same reason: they land in a host’s document, where an
unprefixed name would collide.
The side names top, bottom, left, right are not reserved — they are
keywords only after an endpoint’s : (a:left), so a node may be named |box#left|.
Single quotes (') are reserved and are not strings.
Value keywords are contextual, not reserved as ids — flow, grid, stack, tree,
sequence, chart, pie, drawing, floorplan, schematic, row, column, radial,
bilateral, start, center, end, stretch, evenly, origin, none, auto,
orthogonal, natural, straight, px mean their keyword only after the property that
expects them. Every built-in type — the primitives (SPEC 7),
the templates (SPEC 8), and each layout’s own types
(SPEC 13–SPEC 16) — is protected from a
define shadowing it, free as an id.
Function names rgb, rgba, hsl, repeat are reserved only before ( — as are
hatch, grid / radial (in pattern:), and the pen calls (move, left, right,
up, down, line, angle, arc, curve, fillet, chamfer, circle, close)
inside a draw: value.
In link-operator position the marker glyphs + (one) and o (zero) are contextual —
they compose the ER cardinality marker (SPEC 9) and mean nothing elsewhere;
o is valid only next to a max glyph (-o<, +o-, …), so it never collides with an id or
the round measuring op (o) (delimited by parens). A leading + not followed by a digit
starts a cardinality op, mirroring -. The digit 0 is not part of any operator — a
round endpoint is marker-end: circle (a larger filled dot,
SPEC 7; the hollow ring exists only inside the ER glyphs),
never -o.
Inside a (…) expression (SPEC 10.7), pi, e, and the
sample parameters u / x are keywords, and the math-function names (sin, exp,
min, …) are reserved before ( — all contextual to the expression, free as ids
elsewhere. The backtick ` is unused and reserved.