Skip to content

refactor(parser): move the pipe tokens in AST 1 element ahead#17977

Merged
WindSoilder merged 1 commit intonushell:mainfrom
blindFS:fix_pipe_position
Apr 20, 2026
Merged

refactor(parser): move the pipe tokens in AST 1 element ahead#17977
WindSoilder merged 1 commit intonushell:mainfrom
blindFS:fix_pipe_position

Conversation

@blindFS
Copy link
Copy Markdown
Contributor

@blindFS blindFS commented Apr 3, 2026

Fixes #17957

This could potentially be dangerous! I have no idea whether there're features implemented based on this bug/feature.

This has a hard conflict with #17932, and is better addressed before that.

Release notes summary - What our users need to know

Fixed a bug of lossy parsing of incomplete pipelines end with |, which is noticeable via REPL highlighting.

@github-actions github-actions bot added the A:parser Issues related to parsing label Apr 3, 2026
@blindFS
Copy link
Copy Markdown
Contributor Author

blindFS commented Apr 3, 2026

@WindSoilder I think you're the expert of how pipes work in nushell, please take a look at this.

Basically in foo | bar, the pipe token was assigned to the second element, so it's foo and | bar, now it's foo | and bar instead.

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented Apr 17, 2026

Where are we on this? Waiting for @WindSoilder or ready to land?

@blindFS
Copy link
Copy Markdown
Contributor Author

blindFS commented Apr 17, 2026

Where are we on this? Waiting for @WindSoilder or ready to land?

Let's wait please.

Copy link
Copy Markdown
Contributor

@WindSoilder WindSoilder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for waiting! It looks good to me.
The pipe was required to belong to next command to make sure redirection works. But I believe it's no longer the case after #11934

@WindSoilder WindSoilder added notes:fixes Noted in "Bug fixes" section notes:ready Indicates Ready for Release notes labels Apr 20, 2026
@WindSoilder WindSoilder merged commit ad4a232 into nushell:main Apr 20, 2026
18 checks passed
@github-actions github-actions bot added this to the v0.113.0 milestone Apr 20, 2026
@blindFS blindFS deleted the fix_pipe_position branch April 20, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:parser Issues related to parsing notes:fixes Noted in "Bug fixes" section notes:ready Indicates Ready for Release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lossy parsing of pipe tokens at the end of input, like foo |

3 participants