Commit 87158ea
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 3b61c38 commit 87158ea
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 | |
|---|---|---|---|
| |||
7704 | 7704 | | |
7705 | 7705 | | |
7706 | 7706 | | |
7707 | | - | |
7708 | | - | |
7709 | | - | |
| 7707 | + | |
| 7708 | + | |
7710 | 7709 | | |
7711 | | - | |
7712 | | - | |
| 7710 | + | |
| 7711 | + | |
| 7712 | + | |
| 7713 | + | |
| 7714 | + | |
| 7715 | + | |
7713 | 7716 | | |
7714 | 7717 | | |
7715 | | - | |
| 7718 | + | |
7716 | 7719 | | |
7717 | 7720 | | |
7718 | 7721 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
176 | 186 | | |
177 | 187 | | |
178 | 188 | | |
| |||
0 commit comments