Skip to content

Use double consistently for JSON decimal conversion - #236

Open
Mike Krüger (mkrueger) wants to merge 3 commits into
mainfrom
dev/mkrueger/fix/json-decimal-conversion
Open

Mike Krüger (mkrueger) wants to merge 3 commits into
mainfrom
dev/mkrueger/fix/json-decimal-conversion

Conversation

@mkrueger

Copy link
Copy Markdown
Collaborator

Summary

  • Return double for JSON decimal conversion, matching shell decimal values and arithmetic consumers.
  • Fix numeric JSON strings failing decimal arithmetic and ordered comparisons with invalid casts.
  • Extend the literal/JSON/loop/function value-origin matrix, direct conversion tests, and invariant-culture coverage.
  • Document numeric string coercion while preserving addition as concatenation.

Validation

  • 1570 focused parser and script-scope tests passed.
  • App and test projects build with zero warnings/errors.
  • CLI reproduction now returns 3 for a JSON string containing 2 multiplied by 1.5.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation consistently matches existing shell numeric semantics and includes focused regression coverage and documentation.

Review effort: Balanced
Findings: None

What changed in this PR

Aligns JSON decimal conversion with the shell’s double representation, fixing numeric-string arithmetic and comparisons.

Changes:

  • Converts JSON numbers and numeric strings to invariant-culture double.
  • Expands conversion, value-origin, and culture tests.
  • Documents numeric-string coercion behavior.
File Description
README.md Summarizes numeric-string behavior.
docs/​programming.md Documents coercion rules and examples.
ShellJson.cs Uses double for decimal conversion.
StatementExecutionTests.cs Tests operators across value origins.
ShellObjectConversionTests.cs Verifies direct double conversion.
CultureInvariantConversionTests.cs Tests invariant-culture parsing.
CHANGELOG.md Records the fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-code-quality

github-code-quality Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall line coverage in commit 46aff4a in the dev/mkrueger/fix/jso... branch remains at 66%, unchanged from commit fa2b09c in the main branch.


Updated October 07, 2026 09:33 UTC

@mkrueger

Copy link
Copy Markdown
Collaborator Author

Copilot resolve the merge conflicts in this pull request

…-decimal-conversion

Co-authored-by: mkrueger <341098+mkrueger@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 10:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation consistently fixes the conversion mismatch with comprehensive tests and aligned documentation.

Review effort: Balanced
Findings: None

Copilot AI commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Copilot resolve the merge conflicts in this pull request

Merged main cleanly; no conflict resolution was needed. Merge commit: a6e5467. Focused tests and both builds passed.

Update PR #236 with the latest filter index validation changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 09:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The conversion is consistent with existing shell numeric semantics and is covered across direct, culture-specific, and value-origin scenarios.

Review effort: Balanced
Findings: None

@mkrueger
Mike Krüger (mkrueger) enabled auto-merge (squash) October 7, 2026 10:59
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.

4 participants