Expand description
The structural front end and the host boundary of Polytile (SRD 114 §3, §5.6).
A host may hold a template as text, as JSON text, or as a JSON value
it has already parsed. All three arrive here and leave as a
TileDef, the same statement the tile keyword produces, so the
compiler has one tile to compile. The structural form is turned into
template text first: strings become value holes, string holes, or
statics by the rules of §3.1, and directive arrays and objects
become @for and @if blocks by the rules of §3.2. The textual
parser then yields the pieces, which is what makes the two forms
equivalent by construction.
Constants§
- ENCODINGS
- The encodings a tile may declare.
Functions§
- template_
text_ from_ value - Turn a structural template into template text under
options. The text is what an author would have written in atile ... : jsonblock for the same document. - tile_
from_ json_ text - A tile from a structural template in JSON text (§3). The encoding is
json. - tile_
from_ json_ value - A tile from a structural template a host has already parsed (§3).
The encoding is
json. - tile_
from_ text - A tile from template text a host holds: the body of a
tilestatement without the statement.textmay be multi-line; it is taken exactly, as a heredoc body is.