Files
lush/issues/02-backtick-lexing-parsing.md
Cormac Shannon db6f39a2a4 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)
2026-02-18 19:08:59 +00:00

24 lines
848 B
Markdown

# 02 — Complete backtick command lexing and parsing
**Status:** open
**Blocked by:** #01
**Blocks:** #03
Backtick lexing is partially implemented:
- `llex.c`: TK_COMMAND token lexed via `read_string()` on backtick
- `llex.h`: TK_COMMAND enum added
- `lparser.c`: TK_COMMAND handled in `simpleexp()` (as string) and `suffixedexp()` (as func args)
## Remaining work
- Verify the lexer handles edge cases (escaped backticks, newlines, nested quotes)
- Parser must emit code that produces a result table (`{code, stdout, stderr}`) at runtime, not just a string literal
- May need a new opcode (e.g. `OP_COMMAND`) or compile as a call to a built-in execution function
- Add string interpolation inside backticks if decided in #01
## Files touched
- `llex.c` / `llex.h`
- `lparser.c`
- Possibly `lopcodes.h` / `lopcodes.c` if adding a new opcode