Skip to content

Sprout v0.0.28 — multi-line literals

Choose a tag to compare

@fizzexual fizzexual released this 12 Jun 19:41
· 16 commits to main since this release

Multi-line lists, maps, and calls — write data the natural way.

Collections and call arguments can now span as many lines as you like, with an optional trailing comma, so each item gets its own line and reorders cleanly:

make people = [
    {name: "Ada", age: 36},
    {name: "Mo",  age: 17},
]

make config = {
    host: "localhost",
    port: 8080,
    tags: ["a", "b", "c"],
}
  • Newlines and indentation are ignored inside ( ), [ ], { } (Python-style implicit line joining), implemented at the lexer so it uniformly covers lists, maps, and call argument lists.
  • Trailing commas are allowed in lists, maps, calls — and (this release) in match destructuring patterns (is [a, b,]:) and show.
  • Text literals still stay on one line (join with \n). A multi-step lambda inside a bracketed literal must use a one-line body — give it a name first for a multi-step block (Sprout tells you if you hit this).

Hardened by review

A 2-lens adversarial review (+ verification) stress-tested the load-bearing indentation change: it flagged 5 "critical" lexer bugs — all five rejected on verification (unmatched/unclosed/mismatched brackets all give clean, friendly errors; the depth counter is correctly reset and clamped). The 3 real findings — all trailing-comma consistency gaps — were fixed.

28-check test suite; CI green on Linux, macOS, and Windows. Windows installer attached.