From 2d3bc90cc7ee0666facc8a0bf53ff3e23dc2ff61 Mon Sep 17 00:00:00 2001 From: Ákos Kőrösi Date: Thu, 21 May 2026 19:24:30 +0200 Subject: add var expansion --- src/lexparse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lexparse.c b/src/lexparse.c index 4ef228c..18d36ab 100644 --- a/src/lexparse.c +++ b/src/lexparse.c @@ -41,7 +41,6 @@ MaybeToken consolidate_buffer(LexingBuffer* buf) { static MaybeChunk handle_dollar_expansion(char* line, size_t* pos, QuotationMode qmode) { (*pos)++; - if (line[*pos] == '(') { // TODO exit(66); @@ -202,6 +201,13 @@ TokenVec* lex_level(char* line, size_t* pos, char until, TokenVecVec* tok_seq_po } else if (line[*pos] == '\"') { Chunk chunk = collect_double_q_section(line, pos); push_to_Word(&buf.word_germ, chunk); + } else if (line[*pos] == '$') { + MaybeChunk dollar_chunk = handle_dollar_expansion(line, pos, UN_Q); + if (dollar_chunk.some) { + push_to_Word(&buf.word_germ, dollar_chunk.value); + } else { + push_to_String(&buf.lit_germ, '$'); + } } else if (line[*pos] == '<' && line[(*pos)+1] == '(') { *pos += 2; MaybeToken m_tok = consolidate_buffer(&buf); -- cgit v1.2.3