Conversation
ghost1face
left a comment
There was a problem hiding this comment.
Hey @krlosflipdev, thanks for your contribution and help to get this up to spec! I've made some initial comments and will have to look into this deeper.
…ansion.cs` - Replaced dot (.) with `Constants.DOT` in `PathExpansion.cs` - Added `ToonPathExpansionException` - Updated spec generator aligned to v3.0.0
johannschopplich
left a comment
There was a problem hiding this comment.
Love the README overhaul. Thanks! Only one minor suggestion.
Co-authored-by: Johann Schopplich <johann@schopplich.com>
johannschopplich
left a comment
There was a problem hiding this comment.
LGTM (README-wise) – the overall code has to be reviewed by @toon-format/python-maintainers .
Thank you for the contribution!
|
Hi, I've added more commits with updates, I've basically made that the For Windows run For MacOS run |
|
Overall this looks good and I do appreciate the changes. I may take these changes and rebase them while applying some refactoring and some cleanup. @johannschopplich if you don't mind I'd like to request higher level access to be able to contribute directly to push this over the finish line and get a package prepped for release. |
|
Looks like you've got some code that won't compile, the |
|
Opened #23 which supersedes this PR ensuring compilation and cleaning up namespaces, code generation and formatting. Thanks for your contribution! |
Description
This PR implements full compliance with TOON Specification v3.0, including critical bug fixes, test improvements, and comprehensive documentation updates. The implementation now passes all 371 tests (100% pass rate, 0 skipped) with complete specification coverage and is production-ready for .NET 8.0 and 9.0.
Type of Change
Related Issues
Closes #9 - IDictionary check unreachable due to IEnumerable ordering
Changes Made
1. SPEC v3.0 Section 10 Compliance - Objects as List Items
Fixed critical indentation bug in encoder:
src/ToonFormat/Internal/Encode/Encoders.cs:451WriteTabularRows(objects, header, writer, depth + 2, options)(wasdepth + 1)Example of fixed output:
2. Path Expansion Feature (SPEC Section 13.4)
Added complete path expansion implementation:
src/ToonFormat/Internal/Decode/PathExpansion.cs(187 lines)"a.b.c"into nested objects{"a":{"b":{"c":...}}}ExpandPathsoption toToonDecodeOptions("off"or"safe")"c.d"remain as literal"c.d"instead of expandinga.bexpand to nested objects{"a":{"b":...}}KeyParseResult.WasQuotedpropertyUsage:
3. Scientific Notation Fix (SPEC v3.0 Section 2)
Fixed number encoding to prevent scientific notation:
FormatNumber()inPrimitives.csto convert scientific notation to decimal form0.000001now output as"0.000001"instead of"1E-06"-0→0normalization4. Dictionary Ordering Bug Fix (Issue #9)
Fixed unreachable IDictionary check:
Normalize.csto checkIDictionaryBEFOREIEnumerableNormalizeValue()methods (lines 76 and 168)5. Spec Generator Improvements
Fixed
specgen.shscript issues:.csprojextension todotnet buildcommandGitTool.csto check git clone exit codes and capture errors6. Test Suite Enhancements
Fixed all 12 initially failing tests:
ExpandPaths = "safe"to all path expansion testsNew test files:
tests/ToonFormat.Tests/Encode/ArraysObjectsManual.cs(137 lines)tests/ToonFormat.Tests/PerformanceBenchmark.cs(131 lines)Updated test files:
7. Documentation Updates
XML Documentation:
Constants.csREADME.md Enhancements:
SPEC Compliance
Conformance Checklist Status (Section 13.1 & Section 13.2)
Encoder Compliance:
Decoder Compliance:
Testing
Test Results:
Test Coverage:
Checklist
dotnet formatAdditional Context
Performance Impact
ExpandPathsoptionQuoted Key Tracking Implementation
Path expansion now correctly handles quoted dotted keys:
Parser.KeyParseResultto includeWasQuotedpropertyDecoders.DecodeObjectto track quoted keys during parsingPathExpansion.ExpandPathsto skip expansion for quoted keysToonDecoder.Decodeto pass quoted keys set through the pipelineBehavior:
a.b: 1(unquoted) → Expands to{"a":{"b":1}}"c.d": 2(quoted) → Remains as{"c.d":2}Files Changed
Core Implementation (29 files, +1205/-164 lines):
Key Files Modified:
src/ToonFormat/Internal/Decode/PathExpansion.cs(added quotedKeys parameter)src/ToonFormat/Internal/Decode/Decoders.cs(tracking quoted keys)src/ToonFormat/Internal/Decode/Parser.cs(WasQuoted property)src/ToonFormat/ToonDecoder.cs(passing quoted keys to expansion)src/ToonFormat/Internal/Encode/Encoders.cs(Section 10 fix)src/ToonFormat/Internal/Encode/Primitives.cs(scientific notation fix)src/ToonFormat/Internal/Encode/Normalize.cs(Issue IDictionary Normalize value #9 fix)tests/ToonFormat.Tests/Decode/PathExpansion.cs(unskipped test)README.md(comprehensive rewrite)Migration Notes
This PR is backward compatible with one exception: