Commit e9c4324
fix(decoder): handle nested list-format arrays correctly (#7)
The decoder was incorrectly parsing nested list-format arrays like
`[[[1]]]` because it couldn't distinguish between inline arrays
(`[N]: val1,val2`) and list-format array headers (`[N]:` with nested
content below).
Changes:
- Updated regex patterns to require content after `: ` for inline arrays
- Added new case for list-format array headers ending with `:$`
- Added `parse_nested_list_array` function using existing helpers
- Consolidated edge_cases_test.exs into roundtrip_test.exs
- Renamed test file to roundtrip_test.exs (more idiomatic name)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 2b052b8 commit e9c4324
File tree
3 files changed
+395
-90
lines changed- lib/toon/decode
- test/toon
3 files changed
+395
-90
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
585 | | - | |
586 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
587 | 588 | | |
588 | 589 | | |
589 | 590 | | |
| |||
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
617 | | - | |
618 | | - | |
| 618 | + | |
| 619 | + | |
619 | 620 | | |
620 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
621 | 626 | | |
622 | 627 | | |
623 | 628 | | |
| |||
962 | 967 | | |
963 | 968 | | |
964 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
965 | 985 | | |
966 | 986 | | |
967 | 987 | | |
| |||
This file was deleted.
0 commit comments