Commit ac07116
authored
fix(parser): reconstruct braces in process substitution token loop (#970)
## 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
- [x] 3 new spec tests: `process_subst_group_pipe`,
`process_subst_group_pipe_tac`, `process_subst_group_pipe_sort`
- [x] All existing procsub tests still pass
- [x] Manual verification: `cat < <({ echo "line1"; echo "line2"; } |
cat)` now outputs correctly
- [x] `cargo fmt --check` clean
- [x] `cargo clippy` clean
- [x] Full test suite green
Closes #9471 parent b7b2281 commit ac07116
File tree
2 files changed
+40
-0
lines changed- crates/bashkit
- src/parser
- tests/spec_cases/bash
2 files changed
+40
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2448 | 2448 | | |
2449 | 2449 | | |
2450 | 2450 | | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
2451 | 2462 | | |
2452 | 2463 | | |
2453 | 2464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
0 commit comments