mirror of
https://github.com/nushell/nushell.git
synced 2025-03-30 10:37:29 +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
|
||||
}
|
||||
} else {
|
||||
None
|
||||
// for empty closures
|
||||
Some((outer_span, FlatShape::Closure))
|
||||
};
|
||||
|
||||
output.extend(flattened);
|
||||
|
Loading…
Reference in New Issue
Block a user