Skip to main content

Module tile

Module tile 

Source
Expand description

Polytile at the host boundary (SRD 114 §5.6): build a tile from template text, from structural JSON text, or from a parsed JSON value, then compile it with a program via tile::compile_polydat_with_tiles.

Re-exports§

pub use crate::dsl::compile::compile_polydat_kernel_with_tiles;
pub use crate::dsl::compile::compile_polydat_with_tiles;

Structs§

Span
A source location for error reporting.
TileDef
A tile definition: its header, its raw body, and the parsed template.
TileOptions
Per-tile template options (SRD 114 §2.3): the hole delimiters, the directive sigil, and strictness.

Enums§

TileBodyKind
How a tile body was written, so the printer can reproduce it.
TilePiece
One element of a parsed template.

Constants§

ENCODINGS
The encodings a tile may declare.

Functions§

parse_template
Parse a tile body into pieces under opts. span is the tile statement’s position, used for diagnostics.
render_template
Render pieces back to template text under opts, the inverse of parse_template up to whitespace inside directives.
template_text_from_value
Turn a structural template into template text under options. The text is what an author would have written in a tile ... : json block 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 tile statement without the statement. text may be multi-line; it is taken exactly, as a heredoc body is.