Skip to content

Commit 7b09c86

Browse files
Merge branch 'main' into claude/parser-trailing-comma-148
2 parents bb3e08f + 29c1bc8 commit 7b09c86

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.claude/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Both are FOSS with independent governance (no Big Tech).
8383
7. **No Kotlin/Swift for mobile** - Use Tauri 2.0+ or Dioxus.
8484
8. **MPL-1.0 / MPL-1.0-or-later are non-conforming** - Rewrite to MPL-2.0 in SPDX headers and LICENSE files when encountered (Hypatia's `validate_license` flags both).
8585

86-
### TypeScript / JavaScript Exemptions (Approved)
86+
### TypeScript Exemptions (Approved)
8787

8888
The "no new TypeScript" / "no new JavaScript" rules have approved exemptions in this repo. These paths are *not* policy violations — they are documented carve-outs because the file format or downstream consumer requires the source language. They are honoured by Hypatia's scanner via path-based exemption + the per-repo CLAUDE.md exemption tables.
8989

lib/parser.mly

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,18 @@ expr_record_body:
974974
(* spread-only: { ..var } or { ..expr } *)
975975
| sp = expr_record_spread
976976
{ ([], Some sp) }
977+
(* Rust-style record-update: spread first, then comma-separated fields:
978+
`Record #{ ..base, field: x, other: y }`. Required by sustainabot
979+
hand-port (gitbot-fleet#148) — `Model #{ ..model, totalProcessed: n }`
980+
in Oikos.affine and `Router #{ ..router, routes: rs }` in Router.affine.
981+
The leading spread captures the source-of-defaults; subsequent fields
982+
override. Mirrors the existing trailing-spread form below (`{ f: v,
983+
..s }`) but in the opposite order. LR(1)-safe: after parsing
984+
`expr_record_spread`, the lookahead is either RBRACE (existing
985+
spread-only rule already reduces) or COMMA (this rule shifts);
986+
the choice is unambiguous on one-token lookahead. Added 2026-05-26. *)
987+
| sp = expr_record_spread COMMA field = record_field rest = expr_record_rest
988+
{ (field :: fst rest, Some sp) }
977989
(* field possibly followed by more: { f: v, ... } *)
978990
| field = record_field rest = expr_record_rest
979991
{ (field :: fst rest, snd rest) }

0 commit comments

Comments
 (0)