mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-27 16:51:15 -03:00
Restore error messages for bare variable assignment
Since #6287, bare variable assignments do not parse, which broke the "Unsupported use of '='" error message. This commit catches parse errors that occur on bare variable assignments. When a statement node fails to parse, then we check if there is at least one prefixing variable assignment. If so, we emit the old error message. See also #6347
This commit is contained in:
@@ -76,3 +76,11 @@ complete -C'a=b xalias '
|
||||
alias envxalias='a=b x'
|
||||
complete -C'a=b envxalias '
|
||||
# CHECK: arg
|
||||
|
||||
# Eval invalid grammar to allow fish to parse this file
|
||||
eval 'a=(echo b)'
|
||||
# CHECKERR: {{.*}}: Unsupported use of '='. In fish, please use 'set a (echo b)'.
|
||||
eval ': | a=b'
|
||||
# CHECKERR: {{.*}}: Unsupported use of '='. In fish, please use 'set a b'.
|
||||
eval 'not a=b'
|
||||
# CHECKERR: {{.*}}: Unsupported use of '='. In fish, please use 'set a b'.
|
||||
|
||||
Reference in New Issue
Block a user