mirror of
https://github.com/nushell/nushell
synced 2025-01-16 15:14:26 +00:00
aec41f3df0
# Description This PR adds a few functions to `Span` for merging spans together: - `Span::append`: merges two spans that are known to be in order. - `Span::concat`: returns a span that encompasses all the spans in a slice. The spans must be in order. - `Span::merge`: merges two spans (no order necessary). - `Span::merge_many`: merges an iterator of spans into a single span (no order necessary). These are meant to replace the free-standing `nu_protocol::span` function. The spans in a `LiteCommand` (the `parts`) should always be in order based on the lite parser and lexer. So, the parser code sees the most usage of `Span::append` and `Span::concat` where the order is known. In other code areas, `Span::merge` and `Span::merge_many` are used since the order between spans is often not known. |
||
---|---|---|
.. | ||
deparse.rs | ||
exportable.rs | ||
flatten.rs | ||
known_external.rs | ||
lex.rs | ||
lib.rs | ||
lite_parser.rs | ||
parse_keywords.rs | ||
parse_patterns.rs | ||
parse_shape_specs.rs | ||
parser.rs | ||
parser_path.rs | ||
type_check.rs |