aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-09 01:14:33 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-09 01:14:33 -0400
commit11c560ebccfa3eabb939dafc4139be92edd26842 (patch)
tree43af12019ce7d133a539a0b3a9388e07e82acec6 /parse.c
parent13a9304decb86450a2a0e9cc756da4c2d373c929 (diff)
More path stuff including some methods
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index 454df469..a3f8149b 100644
--- a/parse.c
+++ b/parse.c
@@ -1321,6 +1321,10 @@ PARSER(parse_path) {
}
case '$': {
const char *interp_start = pos;
+
+ if (pos > chunk_start)
+ chunk_text = CORD_asprintf("%r%.*s", chunk_text, (size_t)(pos - chunk_start), chunk_start);
+
if (chunk_text) {
ast_t *literal = NewAST(ctx->file, chunk_start, pos, TextLiteral, .cord=chunk_text);
chunks = new(ast_list_t, .ast=literal, .next=chunks);