Skip to main content

Module template

Module template 

Source
Expand description

The LGX template vocabulary the editor completes and paints with.

A View: / Head: body is HTML whose {…} groups are either a TAG — {if c:}, {for each x in xs:}, {end} — or a HOLE: a LOGOS expression, optionally piped through filters ({price | money}). The template parser in logicaffeine_language::lgx::template owns the grammar; this module holds the two things an editor needs from it, once: the phrase that opens each tag (with the shape MalformedTag teaches), and the clause words inside a tag.

Constants§

FOR_EACH_CLAUSES
The clause words a {for each …:} tag carries after its pattern.
TAGS
Every template tag: the phrase that opens it, and its shape as MalformedTag spells it.

Functions§

filter_pipes
The byte ranges of text’s top-level | separators — the filter pipes of a hole. A | inside a string or a bracketed group is part of an expression, not a pipe.
is_comment
A {# … #} template comment.
tag_phrase
The tag phrase inner (a {…} group’s text, braces excluded) opens with, and the byte length of the phrase within inner including any leading whitespace — None for a hole.