Skip to content

Conversation

@239573049
Copy link
Contributor

@239573049 239573049 commented Dec 16, 2025

Linked Issue

Closes #

Description

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Changes Made

SPEC Compliance

  • This PR implements/fixes spec compliance
  • Spec section(s) affected:
  • Spec version:

Testing

  • All existing tests pass
  • Added new tests for changes
  • Tests cover edge cases and spec compliance

Pre-submission Checklist

  • My code follows the project's coding standards
  • I have run code formatting/linting tools
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation if needed
  • I have reviewed the TOON specification for relevant sections

Breaking Changes

  • No breaking changes
  • Breaking changes (describe migration path below)

Additional Context

239573049 and others added 11 commits November 6, 2025 16:12
- Implement StringUtils for string manipulation, including escaping and unescaping.
- Create ValidationShared for key validation and safety checks.
- Introduce ToonDecodeOptions and ToonEncodeOptions for customizable encoding/decoding settings.
- Develop ToonDecoder for parsing TOON format strings into JsonNode objects.
- Implement ToonEncoder for converting data structures into TOON format strings.
- Add ToonFormatException for error handling during parsing and encoding.
- Create unit tests for ToonDecoder and ToonEncoder to ensure functionality and data integrity.
- Remove outdated UnitTest1.cs file.
Optimize the performance of the `ParseDelimitedValues` and `ToParsedLines` methods:
- Reduce memory allocation by using `StringBuilder` and `ReadOnlySpan<char>`.
- Allocate capacity in advance to avoid dynamic resizing.
- Replace string operations with more efficient logic.
Fix the code formatting and logic of `IsArrayHeaderAfterHyphen` and `ParseStringLiteral`:
- Adjust the format of the `return` statement.
- Eliminate redundant code.
New `MapRowValuesToPrimitives` method:
- Supports mapping string arrays to JSON primitive values.
Other minor optimizations:
- Fixed the logic for handling blank lines.
- Replaced some string operations with more efficient implementations.
- Fixed the issue of character encoding in comments, improving code readability.
…rs, and a new FloatUtils utility class has been added.

Introduce the FloatUtils utility class and provide the NormalizeSignedZero method,
to uniformly handle the logic of negated zero normalization for floating-point numbers, replacing the original repetitive implementations.
Update the relevant code in Parser.cs and Normalize.cs to enhance readability.
Add the NearlyEqual method for approximate comparison of floating-point numbers.
Delete the references to the Internal\Shared\ folder.
…tructure, and optimize the code implementation.
@239573049 239573049 requested a review from a team as a code owner December 16, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants