Phase 6b: a handler's query is @Queries only; drop the signature clauses

The handler-signature `query (vars) [terms] where …` clause and the
`reads`/`writes` clauses overlapped the `@Queries` annotation (and each other):
two ways to attach a query to a handler. Consolidated on the decorator.

  - parse_system no longer parses `query`/`reads`/`writes` clauses; it keeps the
    postfix `@anno(...)` channel and `phase`. A handler's query is the prefix
    `@Queries(these: [...], on: Model)` annotation. Data-access hints are now
    `@Reads(...)`/`@Writes(...)` — absorbed by the generic annotation skipper,
    same parse-and-reserve status the old clauses had.
  - The inline `for (…) in query […] where …` statement is unchanged and still
    covers cross-property constraints / multiple kind filters. `query` stays a
    keyword there (now dispatched via is_id so the vocabulary check sees it).

examples/hello.ludic and examples/qdecl.ludic migrated to `@Queries` (qdecl now
demonstrates a per-property constraint + `on:` tag); outputs unchanged
(4 4 10 3 / 0 3 -2). LANGUAGE.md handler sections rewritten. Vocabulary: drop
`reads`/`writes` from CLAUSE (ludic_syntax.h, grammar, LudicTokens.kt).

Reseeded (21931 lines); C-free fixpoint holds; goldens identical; 17/17;
vocab + doc-fences clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-08-27 23:20:09 +03:00
parent da48dc8499
commit 3fd599ce47
10 changed files with 2829 additions and 3071 deletions

View file

@ -42,11 +42,11 @@ ok "self-host suite: $CORR checks passed (see ./selfhost/test.sh)"
echo "== documented syntax stays compilable (guards against spec/compiler drift) =="
# Compiles a feature example end-to-end (parse -> lower -> link). qdecl exercises
# the `query (vars) [terms] where ...` clause in a system SIGNATURE.
# a @Queries annotation with a per-property constraint and an `on:` model tag.
qsmoke() { # name
local n="$1"
if ./selfhost/game-build.sh build/ludicc "examples/$n.ludic" "/tmp/ludic_${n}_s" >/tmp/qs.out 2>&1; then
ok "$n compiles (signature-query desugars to S_QUERY)"
ok "$n compiles (@Queries desugars to S_QUERY)"
else bad "$n: $(tail -1 /tmp/qs.out)"; fi
}
qsmoke qdecl