Commit 21e6525
Multi-line
`do { "a" "b" "c" }` and `prompt({ "a" "b" })`, with the bare single-string form
unchanged. The shape is `doc_block`'s, which RIDDL already uses for prose, so this adds
no new spelling to the language -- and the bare form deliberately takes EXACTLY ONE
string rather than admitting juxtaposition, since `do "a" "b"` parses unambiguously
(nothing else starts with a quote) but leaves nothing except the next keyword to mark
where the statement ends.
`what` and `prompt` become Seq[LiteralString], with `text` deriving the \n-separated
prose riddlg reads. One representation, so there is no second field to disagree with
it, and a single-line `do` is a Seq of one rather than a special case.
Additive at every layer, which is the load-bearing property: a one-line `do` prettifies
byte-identically to before, and serializes to a bare JSON string rather than an array,
so none of the corpus's 190 models move for a feature they do not use. Several lines get
one per line inside braces -- the layout every other block uses. Squashing them onto one
line would have been the narrow second copy of a block dispatch that InvariantBlock was
already caught being.
All four reflectivity surfaces move together: parser, EBNF (a new literal_string_block
rule, verified by TatSu accepting the new fixture), prettify with a convergence test, and
BAST plus JSON with their own round-trip suites. FORMAT_REVISION 22 -> 23, because both
now write a SEQUENCE where they wrote a bare string, so a revision-22 file's string is
read as a COUNT and everything after it derails -- a misalignment rather than a clean
failure, which is the whole reason the gate exists. The JSON reader accepts either a
string or an array, so nothing already written stops loading.
Three suites pin the revision number so it cannot be silently reused; they reddened on
the bump exactly as intended and now read 23. NotImplemented.bast is regenerated per the
recipe in BACKLOG 0.3 -- from its own directory, 93 bytes, differing at byte 12 and
nowhere else.
Prettify cases were canary-tested: AbstractValidatingTest is a fixture spec, and a
`(td: TestData)` lambda on a plain spec constructs a Function1 without ever running the
body, so a green suite there proves nothing until you have watched it fail.
The 38 corpus round-trip failures are the inherited single-state morph cost, unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>do and prompt, braced like doc_block1 parent ba4c3c9 commit 21e6525
31 files changed
Lines changed: 461 additions & 58 deletions
File tree
- language
- input
- import
- src
- main
- resources/riddl/grammar
- scala/com/ossuminc/riddl/language
- bast
- parsing
- test/scala/com/ossuminc/riddl/language
- parsing
- passes/src
- main/scala/com/ossuminc/riddl/passes
- prettify
- validate
- test/scala-jvm-native/com/ossuminc/riddl/passes
- prettify
- riddlLib/src
- main/scala/com/ossuminc/riddl/json
- test/scala/com/ossuminc/riddl
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
| 471 | + | |
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
665 | 669 | | |
666 | 670 | | |
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
189 | 200 | | |
190 | 201 | | |
191 | 202 | | |
| |||
3417 | 3428 | | |
3418 | 3429 | | |
3419 | 3430 | | |
3420 | | - | |
| 3431 | + | |
3421 | 3432 | | |
3422 | 3433 | | |
3423 | 3434 | | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
3424 | 3439 | | |
3425 | 3440 | | |
3426 | | - | |
| 3441 | + | |
3427 | 3442 | | |
3428 | 3443 | | |
3429 | 3444 | | |
| |||
3688 | 3703 | | |
3689 | 3704 | | |
3690 | 3705 | | |
3691 | | - | |
| 3706 | + | |
3692 | 3707 | | |
3693 | 3708 | | |
3694 | | - | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
3695 | 3719 | | |
3696 | 3720 | | |
3697 | 3721 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
995 | | - | |
996 | | - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
997 | 1000 | | |
998 | 1001 | | |
999 | 1002 | | |
| |||
2584 | 2587 | | |
2585 | 2588 | | |
2586 | 2589 | | |
2587 | | - | |
| 2590 | + | |
| 2591 | + | |
2588 | 2592 | | |
2589 | 2593 | | |
2590 | 2594 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1116 | 1116 | | |
1117 | 1117 | | |
1118 | 1118 | | |
1119 | | - | |
| 1119 | + | |
| 1120 | + | |
1120 | 1121 | | |
1121 | 1122 | | |
1122 | 1123 | | |
| |||
1434 | 1435 | | |
1435 | 1436 | | |
1436 | 1437 | | |
1437 | | - | |
| 1438 | + | |
| 1439 | + | |
1438 | 1440 | | |
1439 | 1441 | | |
1440 | 1442 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
151 | 155 | | |
152 | 156 | | |
153 | 157 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
193 | 204 | | |
194 | 205 | | |
195 | 206 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| |||
0 commit comments