forked from mvdan/sh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
syntax: pipes are left-associative too
That is, the program: foo | bar | baz Should parse with recursive pipes at the left, like: | | baz foo bar We already did this for && and ||, but not pipes. This makes the syntax parser more consistent and correct. We noticed now because we added an optimization where a shell's pipe would reuse copy buffers. With right associativity, the original shell performs all pipes, so the same buffer was used by multiple copies at the same time, resulting in bugs. In other words, a shell pipe forks the left side into a subshell, so nested pipes should go to the subshell.
- Loading branch information
Showing
2 changed files
with
20 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters