ludic/examples/rejected/resource_field.ludic
Orkuncakilkaya e543525eb7 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>
2026-09-24 14:00:20 +03:00

11 lines
301 B
Text

# L9: a resource file's entries are checked against the record, at the file's own line
program ResourceField {
numbers float
property Tool {
key: string = ""
name: string = ""
weight: float = 0.0
}
registry Tools of Tool from "data/bad_tools.lres"
entry { print(TOOLS_COUNT) }
}