feat(lang): L9 resource files - registry ... from

registry NAME of RECORD [as PREFIX] from "file.lres" fills a registry from a data
file of key { field: value } entries, read at compile time with the record as its
schema: every entry is checked like a def, errors name the resource file's line,
nested records and lists of them are bare { } / [{ }] typed by their fields, and
values are expressions in the registry's module. The entries are compiled in, so
nothing parses at start-up and a build that succeeds has validated its resources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-24 14:00:20 +03:00
parent 7e7f3ab297
commit e543525eb7
15 changed files with 46229 additions and 44690 deletions

View file

@ -296,6 +296,7 @@ function p_primary() -> Node {
let n = node(E_ID); n.s = t.text; pi += 1; return n
}
if is_op("(") { pi += 1; skipnl(); let e = expr(); skipnl(); eat_op(")"); return e }
if g_res_mode and is_op("{") { return record() } # L9: a resource's nested record, typed by its field
perr("expected expression")
return node(E_INT)
}