Skip to content

fix(parser): reconstruct braces in process substitution token loop#970

Merged
chaliy merged 1 commit intomainfrom
fix/issue-947-procsub-group-pipe
Apr 2, 2026
Merged

fix(parser): reconstruct braces in process substitution token loop#970
chaliy merged 1 commit intomainfrom
fix/issue-947-procsub-group-pipe

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 2, 2026

Summary

  • Fix group command { ... } piped to another command producing no output inside process substitution < <(...)
  • Root cause: LeftBrace and RightBrace tokens were missing from the process substitution parser's token reconstruction loop, silently dropping them
  • Added 3 spec tests covering group+pipe, group+tac, group+sort inside process substitution

What

The process substitution parser reconstructs command strings from tokens to re-parse them. The match block handled Pipe, Semicolon, And, Or, etc. but was missing LeftBrace and RightBrace. These fell through to the catch-all _ branch which silently dropped them, turning { echo a; echo b; } | cat into echo a; echo b; | cat.

Test plan

  • 3 new spec tests: process_subst_group_pipe, process_subst_group_pipe_tac, process_subst_group_pipe_sort
  • All existing procsub tests still pass
  • Manual verification: cat < <({ echo "line1"; echo "line2"; } | cat) now outputs correctly
  • cargo fmt --check clean
  • cargo clippy clean
  • Full test suite green

Closes #947

The process substitution parser reconstructs command strings from tokens
but was missing handlers for LeftBrace and RightBrace. These tokens fell
through to the catch-all branch which silently dropped them, causing
`{ echo a; echo b; } | cat` inside `<(...)` to lose its group structure.

Closes #947
@chaliy chaliy merged commit ac07116 into main Apr 2, 2026
27 checks passed
@chaliy chaliy deleted the fix/issue-947-procsub-group-pipe branch April 2, 2026 05:23
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.

Group command { ... } piped to command produces no output inside process substitution

1 participant