aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-19 13:23:59 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-19 13:23:59 -0400
commitea6f9797be2b6c1f65cf3b5594f8fb062ba92e9e (patch)
tree059321864c62c578c534285cd3426337bb1c2f98
parent4e732a718dc57f3c06af5ca9e43e4744b87ba72d (diff)
Support DSL constructor working on DSL itself
-rw-r--r--compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index d3fb4523..485e247f 100644
--- a/compile.c
+++ b/compile.c
@@ -2502,6 +2502,9 @@ CORD compile(env_t *env, ast_t *ast)
const char *lang = Match(t, TextType)->lang;
if (lang) { // Escape for DSL
type_t *first_type = get_type(env, call->args->value);
+ if (type_eq(first_type, t))
+ return compile(env, call->args->value);
+
binding_t *esc = get_lang_escape_function(env, lang, first_type);
if (!esc)
code_err(ast, "I don't know how to convert %T to %T", first_type, t);