Check for unsupported "time &" in the proper place

This means we can detect this error also for simple blocks.

While at it do some cleanup in the area.
This commit is contained in:
Johannes Altmanninger
2024-05-03 09:31:55 +02:00
parent a126d2aeba
commit 4e816212a1
3 changed files with 26 additions and 28 deletions

View File

@@ -68,7 +68,7 @@ $fish -c 'echo {$,}'
echo "bind -M" | $fish
# CHECKERR: bind: -M: option requires an argument
# CHECKERR: Standard input (line 1):
# CHECKERR: Standard input (line 1):
# CHECKERR: bind -M
# CHECKERR: ^
# CHECKERR: (Type 'help bind' for related documentation)
@@ -118,6 +118,11 @@ $fish -c 'echo (time echo foo &)'
# CHECKERR: echo (time echo foo &)
# CHECKERR: ^~~~~~~~~~~~~~~~^
$fish -c 'time begin; end &'
# CHECKERR: fish: 'time' is not supported for background jobs. Consider using 'command time'.
# CHECKERR: time begin; end &
# CHECKERR: ^~~~~~~~~~~~~~~~^
$fish -c 'echo (set -l foo 1 2 3; for $foo in foo; end)'
# CHECKERR: fish: Unable to expand variable name ''
# CHECKERR: set -l foo 1 2 3; for $foo in foo; end