mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 19:31:14 -03:00
Minimize logic
This commit is contained in:
10
src/ast.rs
10
src/ast.rs
@@ -3603,11 +3603,11 @@ fn new_decorated_statement(slf: &mut Populator<'_>) -> Box<StatementVariant> {
|
||||
ParseKeyword::kw_switch,
|
||||
ParseKeyword::kw_while,
|
||||
];
|
||||
if (help_only_kws.contains(&self.peek_token(0).keyword)
|
||||
&& self.peek_token(1).is_help_argument)
|
||||
|| (!help_only_kws.contains(&self.peek_token(0).keyword)
|
||||
&& self.peek_token(1).is_dash_prefix_string())
|
||||
{
|
||||
if if help_only_kws.contains(&self.peek_token(0).keyword) {
|
||||
self.peek_token(1).is_help_argument
|
||||
} else {
|
||||
self.peek_token(1).is_dash_prefix_string()
|
||||
} {
|
||||
return new_decorated_statement(self);
|
||||
}
|
||||
|
||||
|
||||
@@ -674,7 +674,7 @@ fn process_opening_quote(
|
||||
1,
|
||||
);
|
||||
}
|
||||
if brace_offsets.is_empty() {
|
||||
if brace_offsets.pop().is_none() {
|
||||
return self.call_error(
|
||||
TokenizerError::closing_unopened_brace,
|
||||
self.token_cursor,
|
||||
@@ -683,7 +683,6 @@ fn process_opening_quote(
|
||||
0,
|
||||
);
|
||||
}
|
||||
brace_offsets.pop();
|
||||
if brace_offsets.is_empty() {
|
||||
mode &= !TOK_MODE_CURLY_BRACES;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user