mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
Simplify check for bare builtin invocation
This commit is contained in:
@@ -3579,8 +3579,7 @@ fn new_decorated_statement(slf: &mut Populator<'_>) -> StatementVariant {
|
|||||||
// e.g. a "naked if".
|
// e.g. a "naked if".
|
||||||
let naked_invocation_invokes_help =
|
let naked_invocation_invokes_help =
|
||||||
![ParseKeyword::Begin, ParseKeyword::End].contains(&self.peek_token(0).keyword);
|
![ParseKeyword::Begin, ParseKeyword::End].contains(&self.peek_token(0).keyword);
|
||||||
if naked_invocation_invokes_help
|
if naked_invocation_invokes_help && self.peek_token(1).typ == ParseTokenType::terminate
|
||||||
&& [ParseTokenType::terminate].contains(&self.peek_token(1).typ)
|
|
||||||
{
|
{
|
||||||
return new_decorated_statement(self);
|
return new_decorated_statement(self);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user