writeonce/compiler/test
shoney.arickathil ac134c9a3b feat(compiler): query order-by + take (9b cont.)
- `order by <field> [desc]` on whole-row queries: a selection sort over
  the result multi, re-reading the key per element via the range var
  (DB_GET_FIELD); O(n^2), KISS, no cost planner — the result sets are
  small by design
- Text order keys use a new WO_B_STR_LT builtin (content compare, reusing
  the WO_B_SORT elem_cmp); scalar keys use the LT opcode. The bug this
  fixes: op_lt on two Text pointers compares ADDRESSES
- `take N`: clamp to count, slice [0,N). `take` is the KwTake keyword,
  not an Ident — matched as the token
- two bugs found + fixed while testing: multi-line query clauses (skip
  the separating newlines) and the key-kind read (must bind the range
  var BEFORE ty_of_expr of the order key, or a Text key silently uses
  op_lt); Index typechecks to the container's element type (`ds[0]`)
- fixture run/db-query-order; oop-e2e 75/0, woc-test 566/0, 15 runtime
  suites, log-watcher 7/0
- employee `seed`/`list`/`staff` modes now compile and run; report
  (group-by+projection), raise (update), drop (delete) remain

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 05:20:17 +02:00
..
fixtures/driver feat(compiler): iteration 5 Tasks 1-4 — modules, language surface, switch, typedef records + enum variants 2026-08-12 14:40:07 +02:00
golden feat: insert executes (iteration 9, Task 3) -- DB_STUB retires for insert 2026-08-15 11:15:06 +02:00
dune feat(compiler): MVS ownership pass + woc driver; drop Money/SKU/Float, reject abstract 2026-08-10 21:24:50 +02:00
runner.ml feat(compiler): query order-by + take (9b cont.) 2026-08-16 05:20:17 +02:00
test_diag.ml feat(compiler): Tasks 1-4 — scaffold, diagnostics, lexer, declaration parser 2026-08-10 09:00:08 +02:00