Repository navigation
Commit 280e1cd
Parser: collapse double-parens at call sites with records
Call-site `(…)` now accepts the same content as a record primary.
Named items or a trailing `,` signal "one record arg"; pure-positional
lists keep today's curried fold so existing code is unchanged:
f() App(f, UnitValue) unchanged
f(x) App(f, x) unchanged
f(x, y) App(App(f, x), y) unchanged (curried)
f((age: 30)) App(f, record) unchanged (inner primary is record)
f(age: 30) App(f, record) NEW — collapses to single paren
f(x,) App(f, 1-record(x)) NEW — trailing-comma as record
f(x, name: v) App(f, record) NEW — mixed items
Surface-syntax only; no semantic shift. Ronald's framing: "application
is a space, and (…) is either grouping or a record — both work the
same way whether or not the function is juxtaposed with them."
Playground examples with record args now use single parens:
getName(name: "Ada", age: 42)
useName(age: 30)
ToString(x: 1, y: 2)
Two new parser tests verify the collapse and the equivalence with
the double-paren form.
Tests: 87 Parser + 75 Core + 25 Playground (all green).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 8fb080b commit 280e1cd
3 files changed
Lines changed: 38 additions & 9 deletions
File tree
- src
- TypeFighter.Parser01.Tests/TestCases
- TypeFighter.Parser01
- web/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
394 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
395 | 401 | | |
396 | 402 | | |
397 | | - | |
| 403 | + | |
| 404 | + | |
398 | 405 | | |
399 | 406 | | |
400 | | - | |
401 | | - | |
402 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
403 | 418 | | |
404 | | - | |
| 419 | + | |
405 | 420 | | |
406 | 421 | | |
407 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
0 commit comments