diff options
author | LemonBoy <thatlemon@gmail.com> | 2022-05-06 13:14:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-06 13:14:50 +0100 |
commit | 2eaef106e4a7fc9dc74a7e672b5f550ec1f9786e (patch) | |
tree | 543832333e5ef90b9e51477457a7e65572274227 /src/eval.c | |
parent | e7d6dbc5721342e3d6b04cf285e4510b5569e707 (diff) |
patch 8.2.4883: string interpolation only works in heredocv8.2.4883
Problem: String interpolation only works in heredoc.
Solution: Support interpolated strings. Use syntax for heredoc consistent
with strings, similar to C#. (closes #10327)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 0c6d2e5ac1..18e196f443 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3769,8 +3769,12 @@ eval7( /* * Environment variable: $VAR. + * Interpolated string: $"string" or $'string'. */ - case '$': ret = eval_env_var(arg, rettv, evaluate); + case '$': if ((*arg)[1] == '"' || (*arg)[1] == '\'') + ret = eval_interp_string(arg, rettv, evaluate); + else + ret = eval_env_var(arg, rettv, evaluate); break; /* |