summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorÁkos Kőrösi <korakos99@gmail.com>2026-05-21 19:24:30 +0200
committerÁkos Kőrösi <korakos99@gmail.com>2026-05-21 19:24:30 +0200
commit2d3bc90cc7ee0666facc8a0bf53ff3e23dc2ff61 (patch)
treed9b5c38a12557a951ed6a6ce825cf5e0177ad49f /src
parent7d2348ece9b72cecd4d5417a4e39ee705c349e0a (diff)
add var expansion
Diffstat (limited to 'src')
-rw-r--r--src/lexparse.c8
1 files changed, 7 insertions, 1 deletions
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);