aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-09 16:54:08 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-09 16:54:08 -0400
commit23de8e1f5a80fdf05469b4961ba0eaafb4531b0e (patch)
tree6ec00ca90b9d0d829869d108e1e3aabdd66a3348 /compile.c
parent0bc207266ed50d628b2071a7be128ace92de3dec (diff)
Fix up some stuff with path escaping
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index ff721b4b..99f94237 100644
--- a/compile.c
+++ b/compile.c
@@ -1909,7 +1909,14 @@ CORD compile(env_t *env, ast_t *ast)
if (chunk->ast->tag == TextLiteral) {
chunk_code = compile(env, chunk->ast);
} else if (chunk_t->tag == TextType && streq(Match(chunk_t, TextType)->lang, lang)) {
- chunk_code = compile(env, chunk->ast);
+ binding_t *esc = get_lang_escape_function(env, lang, chunk_t);
+ if (esc) {
+ arg_t *arg_spec = Match(esc->type, FunctionType)->args;
+ arg_ast_t *args = new(arg_ast_t, .value=chunk->ast);
+ chunk_code = CORD_all(esc->code, "(", compile_arguments(env, ast, arg_spec, args), ")");
+ } else {
+ chunk_code = compile(env, chunk->ast);
+ }
} else if (lang) {
binding_t *esc = get_lang_escape_function(env, lang, chunk_t);
if (!esc)