Skip to content

refactor(interpreter): extract handle_loop_control_flow helper#891

Open
chaliy wants to merge 2 commits intomainfrom
refactor/issue-881-errexit-suppression-helper
Open

refactor(interpreter): extract handle_loop_control_flow helper#891
chaliy wants to merge 2 commits intomainfrom
refactor/issue-881-errexit-suppression-helper

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 28, 2026

Summary

  • Extract handle_loop_control_flow() helper with LoopAction enum to centralize break/continue/return propagation and errexit_suppressed tracking
  • Replaces duplicated pattern across ForCommand, ArithmeticForCommand, and WhileCommand
  • Net -33 lines (92 added, 125 removed)

Test plan

  • All 1810 bash spec tests pass (100%)
  • All 9 set -e tests pass
  • Full cargo test --all-features passes
  • cargo fmt --check and cargo clippy clean

Closes #881

chaliy added 2 commits March 28, 2026 00:08
ForCommand, ArithmeticForCommand, and WhileCommand all duplicated
the same errexit suppression tracking and control flow dispatch.

Extract handle_loop_control_flow() with LoopAction enum to centralize
break/continue/return propagation and errexit_suppressed tracking.

Closes #881
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