Commit 2bbf4d8
authored
fix: fixes bugs and spec alignment (#52)
* fix: treat negative leading-zero tokens as strings per spec v3.0.1
Update spec submodule to latest and fix decoder to treat tokens like
"-05" and "-007" as strings rather than parsing them as numbers. The
spec now explicitly requires forbidden leading zeros in the integer
part to apply to negative numbers as well.
* fix: tabular array round-trip when not first field in list item
The encoder wrote tabular rows at the wrong depth when the array was a
non-first field of a list-item object, and the decoder dropped sibling
fields after parsing such arrays because the tabular parser already
consumed the trailing newline.
* docs: update README spec version references to v3.01 parent 31e76ff commit 2bbf4d8
5 files changed
+30
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| |||
- CONTRIBUTING.md+13-5
- README.md+1-1
- SPEC.md+3-1
- examples/README.md+50-36
- examples/conversions/api-response.toon+14-9
- examples/conversions/config.toon+16-11
- examples/invalid/delimiter-mismatch.toon+3
- examples/valid/delimiter-scoping.toon+5
- examples/valid/key-folding-basic.json+25
- examples/valid/key-folding-basic.toon+3-5
- examples/valid/key-folding-mixed.json+24
- examples/valid/key-folding-mixed.toon+5-3
- examples/valid/key-folding-non-identifier.toon+4
- examples/valid/key-folding-with-array.json+22
- examples/valid/key-folding-with-array.toon+2-3
- examples/valid/objects.toon+1
- package.json+1-1
- tests/fixtures/decode/numbers.json+33
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
998 | 1005 | | |
999 | 1006 | | |
1000 | 1007 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
361 | 369 | | |
362 | 370 | | |
363 | 371 | | |
| |||
467 | 475 | | |
468 | 476 | | |
469 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
470 | 486 | | |
471 | 487 | | |
472 | 488 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
623 | | - | |
| 623 | + | |
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
| |||
0 commit comments