ludic/docs/language/structure
Orkuncakilkaya f5e9b5d6c2 feat(lang): new Type { field: value } record initialisers
`new` accepted only a bare `new T` (every field its declared default) or
`new []T`, but the docs (kw-new) document `new Record { field: value, … }`
as the way to construct a record with non-default fields — a documented,
intended form the parser never accepted (`let o = new Point { x: 3 }` failed
with "expected newline or ';'").

Parse an optional `{ … }` override record after the type in a `new`
expression (reusing the existing `record()` parser that `spawn` uses), and
seed each field in emit_new_struct from that record when present, else from
the field's declared default. `new []T` and bare `new T` are unchanged.

Also mark the illustrative kw-import fence `# doc-check: skip` (its imports
are example paths that can't resolve in isolation), which makes `x check-docs`
fully green (398 fences, 0 drifted) — so it is now wired as a gate in
`x test-tools` and CI, guarding against future doc/compiler drift.

Reseed is a clean fixpoint (x bootstrap-cfree holds); x test (56),
x selfhost-test (29, golden renders unchanged) and x test-tools (30) green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-31 01:20:06 +03:00
..
_section.md docs: automated documentation pipeline (per-symbol source → pages) 2026-08-29 16:25:54 +03:00
kw-const.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00
kw-entry.md feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
kw-enum.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00
kw-extern.md refactor(lang): rename builtins flr->floor and fx->fixed 2026-08-30 02:01:56 +03:00
kw-function.md refactor(lang): rename the fn keyword to function 2026-08-30 01:43:22 +03:00
kw-handler.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00
kw-import.md feat(lang): new Type { field: value } record initialisers 2026-08-31 01:20:06 +03:00
kw-let.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00
kw-model.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00
kw-new.md feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
kw-phase.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00
kw-program.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00
kw-property.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00
kw-public.md feat(stdlib): namespaced standard library (issue #2) 2026-08-30 00:26:19 +03:00
kw-return.md refactor(lang): rename the fn keyword to function 2026-08-30 01:43:22 +03:00
kw-ui.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00
kw-var.md docs(api): per-symbol pages, fuzzy search, deep token linking, hover cards 2026-08-29 17:53:22 +03:00