Remove parser keywords label from commands that do not need it (#8780)

This commit is contained in:
Jakub Žádník
2023-04-07 01:12:21 +03:00
committed by GitHub
parent c12b4b4af7
commit e54b867e8e
9 changed files with 21 additions and 64 deletions

View File

@ -798,8 +798,16 @@ pub fn parse_alias(
let _equals = working_set.get_span_contents(spans[split_id + 1]);
let replacement_spans = &spans[(split_id + 2)..];
let first_bytes = working_set.get_span_contents(replacement_spans[0]);
if is_math_expression_like(working_set, replacement_spans[0], expand_aliases_denylist) {
if first_bytes != b"if"
&& first_bytes != b"match"
&& is_math_expression_like(
working_set,
replacement_spans[0],
expand_aliases_denylist,
)
{
// TODO: Maybe we need to implement a Display trait for Expression?
let (expr, _) = parse_expression(
working_set,