mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
Fix for issue where 'while |' would be incorrectly interpreted as a
"naked statement" causing a wonky error message
This commit is contained in:
parent
4402f73bf7
commit
e2da73bf4f
@ -128,7 +128,7 @@ RESOLVE(statement)
|
|||||||
|
|
||||||
// Likewise if the next token doesn't look like an argument at all. This corresponds to e.g. a "naked if".
|
// Likewise if the next token doesn't look like an argument at all. This corresponds to e.g. a "naked if".
|
||||||
bool naked_invocation_invokes_help = (token1.keyword != parse_keyword_begin && token1.keyword != parse_keyword_end);
|
bool naked_invocation_invokes_help = (token1.keyword != parse_keyword_begin && token1.keyword != parse_keyword_end);
|
||||||
if (naked_invocation_invokes_help && token2.type != parse_token_type_string)
|
if (naked_invocation_invokes_help && (token2.type == parse_token_type_end || token2.type == parse_token_type_terminate))
|
||||||
{
|
{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user