Skip to content

zsh: support double quotes around nested parameter expressions #1214

@LangLangBart

Description

@LangLangBart
./shfmt --language-dialect zsh <<<'${(f)"$(foo)"}'

actual

<standard input>:1:6: invalid parameter name

expected

${(f)"$(foo)"}

related

zsh docs

Note that double quotes may appear around nested expressions, in which case
only the part inside is treated as quoted; for example, ${(f)"$(foo)"} quotes
the result of $(foo), but the flag ‘(f)’ (see below) is applied using the
rules for unquoted expansions.

Source: https://zsh.sourceforge.io/Doc/Release/Expansion.html#Parameter-Expansion#:~:text=Note%20that%20double%20quotes%20may%20appear%20around%20nested%20expressions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions