Repository navigation
Commit 6183df1
authored
fix: keep $ on nested variables in "${...}" interpolation (#2520)
Printing `"${foo[$index_var]}"` swallowed the dollar sign of the nested
variable, producing `"${foo[index_var]}"` and silently changing semantics
(the variable becomes a bare constant). The `variable` printer dropped `$`
for any variable whose parent was an offsetlookup under a curly-simple
encapsedpart, but only the base variable of the lookup (which directly
follows the `${` emitted by the encapsedpart printer) may lose its `$`;
a variable in the offset position is nested and keeps its own `$`.
Closes #2177
Co-authored-by: Dextheking1 <Dextheking1@users.noreply.github.com>1 parent b7711d0 commit 6183df1
3 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2314 | 2314 | | |
2315 | 2315 | | |
2316 | 2316 | | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
2317 | 2321 | | |
2318 | 2322 | | |
2319 | 2323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| 417 | + | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| |||
952 | 953 | | |
953 | 954 | | |
954 | 955 | | |
| 956 | + | |
955 | 957 | | |
956 | 958 | | |
957 | 959 | | |
| |||
1449 | 1451 | | |
1450 | 1452 | | |
1451 | 1453 | | |
| 1454 | + | |
1452 | 1455 | | |
1453 | 1456 | | |
1454 | 1457 | | |
| |||
1988 | 1991 | | |
1989 | 1992 | | |
1990 | 1993 | | |
| 1994 | + | |
1991 | 1995 | | |
1992 | 1996 | | |
1993 | 1997 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
408 | 409 | | |
409 | 410 | | |
410 | 411 | | |
| |||
0 commit comments