Fix four scripting parser and value-conversion bugs - #233
Open
Mike Krüger (mkrueger) wants to merge 1 commit into
Open
Mike Krüger (mkrueger) wants to merge 1 commit into
Mike Krüger (mkrueger) wants to merge 1 commit into
Conversation
…exec Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mike Krüger (mkrueger)
requested review from
a team
and
a balanced review from Copilot
October 2, 2026 12:29
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The value-conversion regression coverage does not follow the repository’s required value-origin matrix.
Review effort: Balanced
Findings: 1
What changed in this PR
Fixes four scripting issues involving loop validation, filter indexes, JSON numeric conversion, and dynamic exec arguments.
Changes:
- Validates loop keywords and filter index ranges.
- Aligns JSON decimal conversion with shell doubles.
- Reuses command argument parsing for
execand adds regression coverage and documentation.
| File | Description |
|---|---|
README.md |
Summarizes corrected scripting behavior. |
docs/programming.md |
Documents conversion, loops, and exec arguments. |
docs/filter-v1-spec.md |
Defines valid filter index bounds. |
StatementParser.cs |
Validates keywords and shares argument parsing. |
ShellJson.cs |
Returns invariant doubles for decimal conversion. |
ExpressionParser.cs |
Rejects overflowing filter indexes. |
ScriptExecutionScopeTests.cs |
Tests invalid scripts and scope restoration. |
StatementParserEdgeTests.cs |
Tests keywords and exec parsing. |
StatementExecutionTests.cs |
Tests loop preflight and numeric strings. |
ShellObjectConversionTests.cs |
Updates JSON conversion expectations. |
FilterPathExpressionTests.cs |
Tests index boundaries and overflow. |
CultureInvariantConversionTests.cs |
Tests culture-independent JSON conversion. |
CommandExecutionTests.cs |
Tests dynamic command argument execution. |
FilterCommandTests.cs |
Tests filter overflow handling. |
CHANGELOG.md |
Records the four fixes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| [InlineData("<=", "false")] | ||
| [InlineData(">", "true")] | ||
| [InlineData(">=", "true")] | ||
| public async Task JsonNumericStrings_MatchTextAcrossValueOrigins(string operation, string expected) |
Code Coverage OverviewLanguages: C# C# / code-coverage/dotnetThe overall line coverage in commit aed1c2b in the Show a line coverage summary of the most impacted files.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fix four scripting bugs that could execute malformed loop headers, select the wrong array element, fail decimal arithmetic on JSON string values, or reject valid dynamic command arguments.
Changes
inkeyword inforheaders andwhileafterdobodies. Invalid headers produce parser diagnostics before any statements in the input execute.Int32.MaxValue, including optional access, instead of silently substituting index zero. Representable indexes outside an array still returnnull.doublerepresentation as other shell values. Numeric JSON strings work in decimal arithmetic and comparisons; string concatenation with+remains unchanged.exec, supporting options with space-separated,=, and:values, negative arguments, URLs, and file patterns while preserving typed expressions.Release scope
This is a follow-up for a future release and should not be included in the current release.