Files
lush/issues/02-backtick-lexing-parsing.md
Cormac Shannon bad40fb65b Standardize issue status labels to done/open/in progress
Rename resolved→done (#1-4, #11), closed→done (#13, #18),
open (post-core)→open (#7), mark #9 as superseded by #21.
2026-03-15 19:33:49 +00:00

24 lines
848 B
Markdown

# 02 — Complete backtick command lexing and parsing
**Status:** done
**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