Commit f18c976
committed
fix(interpreter): expand command substitutions in assoc array keys
Associative array assignments where the key is a command substitution
(e.g. m["$(echo hello)"]="world") silently produced an empty key.
Add async expand_assoc_key() that parses the subscript as a full Word
and expands it with expand_word() when it contains $( or backtick.
Closes #8721 parent a4e09c8 commit f18c976
File tree
2 files changed
+19
-6
lines changed- crates/bashkit
- src/interpreter
- tests/spec_cases/bash
2 files changed
+19
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7714 | 7714 | | |
7715 | 7715 | | |
7716 | 7716 | | |
7717 | | - | |
7718 | | - | |
7719 | | - | |
| 7717 | + | |
| 7718 | + | |
7720 | 7719 | | |
7721 | | - | |
7722 | | - | |
| 7720 | + | |
| 7721 | + | |
| 7722 | + | |
| 7723 | + | |
| 7724 | + | |
| 7725 | + | |
7723 | 7726 | | |
7724 | 7727 | | |
7725 | | - | |
| 7728 | + | |
7726 | 7729 | | |
7727 | 7730 | | |
7728 | 7731 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
205 | 215 | | |
206 | 216 | | |
207 | 217 | | |
| |||
0 commit comments