From 23de8e1f5a80fdf05469b4961ba0eaafb4531b0e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 9 Sep 2024 16:54:08 -0400 Subject: Fix up some stuff with path escaping --- compile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'compile.c') 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) -- cgit v1.2.3