Add project issues for lush (Lua + shell) features
Defines syntax decisions and implementation plan across 7 issues:
- backtick command execution returning {code, stdout, stderr}
- ${expr} interpolation in backticks
- $SIGIL env var read/write
- argv parsing, piping, and redirection (future)
This commit is contained in:
25
issues/06-piping.md
Normal file
25
issues/06-piping.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# 06 — Implement piping between commands
|
||||
|
||||
**Status:** open (post-core)
|
||||
**Blocked by:** #03, #04
|
||||
|
||||
## Syntax
|
||||
|
||||
```lua
|
||||
local result = `ls -l` | `grep ".lua"`
|
||||
```
|
||||
|
||||
## Implementation
|
||||
|
||||
- Connect stdout of one child to stdin of the next via `pipe()` + `dup2()`
|
||||
- Build a pipeline of N processes, all forked and connected
|
||||
- Only capture stdout/stderr of the **final** process
|
||||
- `waitpid()` all children, return exit code of last process
|
||||
|
||||
## Challenge
|
||||
|
||||
Lua uses `|` for bitwise OR. The parser needs to disambiguate:
|
||||
- `|` between two command expressions → pipe
|
||||
- `|` between numeric expressions → bitwise OR
|
||||
|
||||
This is resolvable because the parser knows the type of each subexpression — a backtick expression is always a command.
|
||||
Reference in New Issue
Block a user