Skip to content

refactor(interpreter): extract LoopAccumulator for errexit suppression tracking#896

Merged
chaliy merged 4 commits intomainfrom
fix/issue-881-errexit-suppression-helper
Mar 28, 2026
Merged

refactor(interpreter): extract LoopAccumulator for errexit suppression tracking#896
chaliy merged 4 commits intomainfrom
fix/issue-881-errexit-suppression-helper

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 28, 2026

Summary

  • Extract duplicated loop result accumulation into LoopAccumulator helper in state.rs
  • Consolidates stdout/stderr/exit_code/errexit_suppressed tracking + break/continue/return propagation
  • Used by execute_for, execute_arithmetic_for, and execute_condition_loop
  • Net: +206 / -175 lines (adds helper + 6 unit tests, removes 3x duplicated control flow blocks)

Test plan

  • All existing tests pass (cargo test --all-features)
  • 6 new unit tests for LoopAccumulator (accumulate, break, continue, return, finish)
  • cargo clippy -- -D warnings clean
  • cargo fmt --check clean

Closes #881

chaliy added 4 commits March 28, 2026 09:50
…n tracking

Extract duplicated loop result accumulation (stdout/stderr/exit_code/
errexit_suppressed tracking + break/continue/return propagation) into
a LoopAccumulator helper in state.rs. Used by execute_for,
execute_arithmetic_for, and execute_condition_loop.

Closes #881
@chaliy chaliy merged commit 45c0d75 into main Mar 28, 2026
27 checks passed
@chaliy chaliy deleted the fix/issue-881-errexit-suppression-helper branch March 28, 2026 10:27
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.

Extract errexit suppression propagation helper for compound commands

1 participant