forked from extern/nushell
4f57c5d56e
# Description Fixes: #7786 The issue is because the lite block is wrong while converting from lex tokens # What happened internally? Take the following as example: ``` ❯ def foobar [] { 'hello' out> /tmp/output.1 'world' out> /tmp/output.2 } ``` ## Before: ``` LiteBlock { block: [ LitePipeline { commands: [ Command(None, LiteCommand { comments: [], parts: [Span { start: 40900, end:40907 }] }), Redirection(Span { start: 40908, end: 40912 }, Stdout, LiteCommand { comments: [], parts: [Span { start: 40913, end: 40926 }] })] }, LitePipeline { commands: [ Redirection(Span { start: 40908, end: 40912 }, Stdout, LiteCommand { comments: [], parts: [Span { start: 40929, end: 40936 }] }), // this is wrong, should be command. Redirection(Span { start: 40937, end: 40941 }, Stdout, LiteCommand { comments: [], parts: [Span { start: 40942, end: 40955 }] })] }] } ``` ## After: ``` LiteBlock { block: [ LitePipeline { commands: [ Command(None, LiteCommand { comments: [], parts: [Span { start: 40824, end: 40831 }] }), Redirection(Span { start: 40832, end: 40836 }, Stdout, LiteCommand { comments: [], parts: [Span { start: 40837, end: 40850 }] })] }, LitePipeline { commands: [ Command(None, LiteCommand { comments: [], parts: [Span { start: 40854, end: 40861 }] }), Redirection(Span { start: 40862, end: 40866 }, Stdout, LiteCommand { comments: [], parts: [Span { start: 40867, end: 40880 }] })] } ] } ``` # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. |
||
---|---|---|
.. | ||
assets | ||
proptest-regressions/format_conversions | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
LICENSE |