Commit 0b91a41
authored
fix(interpreter): support exec {var}>&- fd-variable redirect syntax (#1060)
## Summary
- Add parser support for `{varname}` fd-variable redirect syntax (e.g.,
`exec {myfd}>&-`)
- Added `fd_var: Option<String>` to `Redirect` AST node
- Parser detects `{identifier}` pattern before redirect operators via
`pop_fd_var()`
- Interpreter resolves fd variable from shell variables in
`execute_exec_builtin`
## Test plan
- [ ] `exec_fd_variable_close` — close fd via variable reference
- [ ] `exec_fd_variable_open` — open fd via variable reference
- [ ] All 1925 bash spec tests pass
- [ ] Full test suite passes (2226+ tests)
Closes #9641 parent 7e31915 commit 0b91a41
File tree
4 files changed
+102
-7
lines changed- crates/bashkit
- src
- interpreter
- parser
- tests/spec_cases/bash
4 files changed
+102
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3757 | 3757 | | |
3758 | 3758 | | |
3759 | 3759 | | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
| 3765 | + | |
3760 | 3766 | | |
3761 | 3767 | | |
3762 | 3768 | | |
3763 | 3769 | | |
3764 | 3770 | | |
3765 | 3771 | | |
3766 | | - | |
| 3772 | + | |
| 3773 | + | |
3767 | 3774 | | |
3768 | 3775 | | |
3769 | 3776 | | |
| |||
3774 | 3781 | | |
3775 | 3782 | | |
3776 | 3783 | | |
| 3784 | + | |
3777 | 3785 | | |
3778 | | - | |
| 3786 | + | |
3779 | 3787 | | |
3780 | 3788 | | |
3781 | 3789 | | |
3782 | 3790 | | |
3783 | 3791 | | |
3784 | | - | |
| 3792 | + | |
3785 | 3793 | | |
3786 | 3794 | | |
3787 | 3795 | | |
| |||
3794 | 3802 | | |
3795 | 3803 | | |
3796 | 3804 | | |
3797 | | - | |
| 3805 | + | |
3798 | 3806 | | |
3799 | 3807 | | |
3800 | 3808 | | |
| |||
3806 | 3814 | | |
3807 | 3815 | | |
3808 | 3816 | | |
3809 | | - | |
| 3817 | + | |
3810 | 3818 | | |
3811 | 3819 | | |
3812 | 3820 | | |
| |||
5522 | 5530 | | |
5523 | 5531 | | |
5524 | 5532 | | |
| 5533 | + | |
5525 | 5534 | | |
5526 | 5535 | | |
5527 | 5536 | | |
| |||
5565 | 5574 | | |
5566 | 5575 | | |
5567 | 5576 | | |
| 5577 | + | |
5568 | 5578 | | |
5569 | 5579 | | |
5570 | 5580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
488 | 490 | | |
489 | 491 | | |
490 | 492 | | |
| |||
921 | 923 | | |
922 | 924 | | |
923 | 925 | | |
| 926 | + | |
924 | 927 | | |
925 | 928 | | |
926 | 929 | | |
| |||
1049 | 1052 | | |
1050 | 1053 | | |
1051 | 1054 | | |
| 1055 | + | |
1052 | 1056 | | |
1053 | 1057 | | |
1054 | 1058 | | |
| |||
0 commit comments