Commit d22be56
feat(grammar)!: Rust-like record syntax — bare { = block, records use #{ }
BREAKING — do NOT merge standalone; lands atomically with the codemod
migration of all .affine record literals (epic affinescript#218).
`{` in expression position is now ALWAYS a block. Record/struct
literals use the `#{ … }` sigil — both anonymous (`#{ x: 1 }`) and
typed (`Foo #{ x: 1 }`). Eliminates the block-vs-record-literal
ambiguity (#215 families C+D) structurally, plus the Rust
struct-literal-in-if/match-scrutinee hazard. Record patterns
unaffected (no block alternative in pattern position).
HASH_LBRACE token (token.ml) + `#{` lexer rule (lexer.ml, sedlex
multi-char, ordered) + both ExprRecord productions rerouted
(parser.mly). Conflicts 72→68 S/R, 10→7 R/R; build clean.
Refs #218 #215
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a45b021 commit d22be56
3 files changed
Lines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
768 | 769 | | |
769 | 770 | | |
770 | 771 | | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
775 | 777 | | |
776 | 778 | | |
777 | 779 | | |
| |||
787 | 789 | | |
788 | 790 | | |
789 | 791 | | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
795 | 798 | | |
796 | 799 | | |
797 | 800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
| 191 | + | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
| |||
0 commit comments