You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zsh errors out with a parse error for FOO=bar { :; } FOO=bar ( :; ) FOO=bar (( foo )) FOO=bar [[ foo ]] FOO=bar ! :
We should highlight the word after the assignment as an unknown-token (or perhaps other style) as long as these are parse errors.
Literally, the rule is "parameter assignments may precede only a simple command." (In fact the assignment syntax is part of the definition of simple command syntax.)
Of the set of $reswords from zsh/parameter, "nocorrect" and all of the aliases for "typeset" may begin a simple command. The rest may not.
Activity
danielshahaf commentedon Dec 5, 2017
What's the rule?
danielshahaf commentedon Dec 5, 2017
[[
is a reserved word. What about builtins?danielshahaf commentedon Dec 5, 2017
@phy1729 reports builtins don't error
danielshahaf commentedon Dec 6, 2017
Asked upstream about the syntax users/23000
WIP 'main': Highlight reserved words following assignments as errors.
danielshahaf commentedon Dec 6, 2017
Could you have a look at danielshahaf@d2ed7f4?
WIP 'main': Highlight reserved words following assignments as errors.
phy1729 commentedon Jan 20, 2018
Could use a test, but the code looks good.
danielshahaf commentedon Mar 19, 2020
Upstream's answer (by Bart):
tests: Add tests for issue #461.
3 remaining items