diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-09 16:54:08 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-09 16:54:08 -0400 |
| commit | 23de8e1f5a80fdf05469b4961ba0eaafb4531b0e (patch) | |
| tree | 6ec00ca90b9d0d829869d108e1e3aabdd66a3348 /compile.c | |
| parent | 0bc207266ed50d628b2071a7be128ace92de3dec (diff) | |
Fix up some stuff with path escaping
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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) |
