Skip to content

mojo-toml v0.2.2

Choose a tag to compare

@amarbarosys amarbarosys released this 04 Nov 14:41
· 11 commits to main since this release

mojo-toml-public v0.2.2

Released: 2026-11-04 · Commit: 84426c7 · Previous: v0.2.1

What it does

A TOML 1.1 parser written in pure Mojo. It passes the complete official
conformance suite, toml-test v2.2.0:
214/214 valid and 467/467 invalid documents, on Mojo 1.2.0 and on the 1.2 nightly.

from toml import parse

def main() raises:
    var doc = parse(open("config.toml", "r").read())
    var server = doc["server"]
    print(server["host"].as_string(), server["port"].as_int())

Highlights

  • Integer tokens are parsed from a view with no copy and no digit list, so parsing is faster.
  • parse is smoke-tested against random input: it raises, it never crashes.

Changes

Added

  • recipe.yaml: a conda package recipe.
  • A property smoke step in the gate: parse never crashes.
  • mojo-upgrade config.
  • CI, latest-release and license badges in the README.

Changed

  • Integer tokens are parsed from a view, no copy and no digit list.
  • README: one install and quickstart block, one example.

Fixed

  • Integers outside the signed 64-bit range are rejected.
  • Array and inline-table nesting is bounded at 128 levels.
  • Seconds are not inserted before a fraction: 07:32.5 is invalid.

Verified

Check Result
ci-local: the GitHub workflow in a clean Ubuntu 24.04 container (toml-test 214/214 valid, 467/467 invalid) PASS (2351c89)

Known limits

Upgrade / run

uv sync   # installs Mojo 1.2.0

Commits

  • 2351c89 fix(ci): fetch mojo-proptest at a pinned commit when no sibling checkout exists
  • 84426c7 fix(release): pyproject.toml, recipe.yaml, uv.lock say 0.2.2
  • 063bef4 build: mojo-upgrade config
  • a613983 perf(toml): integer tokens are parsed from a view, no copy and no digit list
  • f2b83d1 test: property smoke step, parse never crashes
  • 4a18663 build: conda recipe
  • 961ef4e docs: one example, one install block
  • b272c6a docs: install and quickstart block
  • d99d0b8 build(toml): uv.lock project version 0.2.1
  • 25cf43a refactor(toml): drop the unused TIME_LOCAL import in json.mojo
  • c5a9118 docs(toml): Mojo 1.2.0 everywhere, version 0.2.1 matches the tag
  • a77bfe6 fix(toml): do not insert seconds before a fraction (07:32.5 is invalid)
  • 604e9fd fix(toml): bound array and inline-table nesting at 128
  • 7703ef1 fix(toml): reject integers outside the signed 64-bit range
  • 0a44020 docs: CI, latest-release and license badges