mirror of
https://github.com/nushell/nushell.git
synced 2025-04-02 20:27:11 +02:00
fix: flatten of empty closures (#15374)
Closes #15373 # Description Now `ast -f "{||}"` will return ``` ╭─content─┬─────shape─────┬─────span──────╮ │ {||} │ shape_closure │ ╭───────┬───╮ │ │ │ │ │ start │ 0 │ │ │ │ │ │ end │ 4 │ │ │ │ │ ╰───────┴───╯ │ ╰─────────┴───────────────┴───────────────╯ ``` Similar to those of `ast -f "[]"`/`ast -f "{}"` # User-Facing Changes # Tests + Formatting I didn't find the right place to do the test, except for the examples of `ast` command. # After Submitting
This commit is contained in:
parent
3fe355c4a6
commit
5832823dff
@ -232,7 +232,8 @@ fn flatten_expression_into(
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
None
|
// for empty closures
|
||||||
|
Some((outer_span, FlatShape::Closure))
|
||||||
};
|
};
|
||||||
|
|
||||||
output.extend(flattened);
|
output.extend(flattened);
|
||||||
|
Loading…
Reference in New Issue
Block a user