Repository navigation
-
Builds on released Mojo 1.0. The pixi channel moved from
max-nightlytomaxand the dependency pin from>=1.0.0b3.dev…to
>=1.0,<2; CI installsmojo==1.0.0from PyPI instead of the nightly
index with--prerelease allow. The weekly drift check still runs
against the latest nightly, so the repo still reports when the language
moves under it. -
1.0 source fixes.
_Parser.parse_body'sstopslist and
_make_loop'skeys/valuesare now annotated (List[String]and
List[TemplateValue]). Under 1.0 a bare list expression builds an
Array, which no longer converts to aListparameter. -
README test count corrected: 59 → 104.
-
New
template.errorsmodule (exported from the package), following the
error-reporting pattern shared across the mojo-* parser suite:
line_col(source, offset)maps a byte offset to a 1-based (line, column)
pair — the column is the 1-based BYTE offset within the line, no UTF-8
decoding — andparse_error(msg, source, offset)builds anError
reading<msg> at line <L>, column <C>: '<snippet>', where the snippet
is up to ~30 bytes of the offending line centered on the column,
whitespace-trimmed, with...where truncated, and never multi-line. -
Every lexer and parser error now carries that position + snippet
(previously a bare(line L)suffix): unclosed tags and unclosed
{% if %}/{% for %}point at the tag opener, and expression errors
(unexpected character, unterminated string literal, bad/trailing tokens,
missing]/)/ filter or attribute name, depth-cap errors) point at
the offending byte inside the tag. Tokens now carry byte offsets instead
of line numbers; render-time errors (undefined variables, eval depth) are
unchanged — the AST does not carry source positions. -
No mechanism change: parsing still
raises a plainError(...), no new
error types.